@@ -48,15 +48,15 @@ use pulldown_cmark::{
48
48
mod tests;
49
49
50
50
/// Options for rendering Markdown in the main body of documentation.
51
- pub ( crate ) fn opts ( ) -> Options {
51
+ pub ( crate ) fn main_body_opts ( ) -> Options {
52
52
Options :: ENABLE_TABLES
53
53
| Options :: ENABLE_FOOTNOTES
54
54
| Options :: ENABLE_STRIKETHROUGH
55
55
| Options :: ENABLE_TASKLISTS
56
56
| Options :: ENABLE_SMART_PUNCTUATION
57
57
}
58
58
59
- /// A subset of [`opts ()`] used for rendering summaries.
59
+ /// A subset of [`main_body_opts ()`] used for rendering summaries.
60
60
pub ( crate ) fn summary_opts ( ) -> Options {
61
61
Options :: ENABLE_STRIKETHROUGH | Options :: ENABLE_SMART_PUNCTUATION | Options :: ENABLE_TABLES
62
62
}
@@ -975,7 +975,7 @@ impl Markdown<'_> {
975
975
}
976
976
} ;
977
977
978
- let p = Parser :: new_with_broken_link_callback ( md, opts ( ) , Some ( & mut replacer) ) ;
978
+ let p = Parser :: new_with_broken_link_callback ( md, main_body_opts ( ) , Some ( & mut replacer) ) ;
979
979
let p = p. into_offset_iter ( ) ;
980
980
981
981
let mut s = String :: with_capacity ( md. len ( ) * 3 / 2 ) ;
@@ -994,7 +994,7 @@ impl MarkdownWithToc<'_> {
994
994
crate fn into_string ( self ) -> String {
995
995
let MarkdownWithToc ( md, mut ids, codes, edition, playground) = self ;
996
996
997
- let p = Parser :: new_ext ( md, opts ( ) ) . into_offset_iter ( ) ;
997
+ let p = Parser :: new_ext ( md, main_body_opts ( ) ) . into_offset_iter ( ) ;
998
998
999
999
let mut s = String :: with_capacity ( md. len ( ) * 3 / 2 ) ;
1000
1000
@@ -1019,7 +1019,7 @@ impl MarkdownHtml<'_> {
1019
1019
if md. is_empty ( ) {
1020
1020
return String :: new ( ) ;
1021
1021
}
1022
- let p = Parser :: new_ext ( md, opts ( ) ) . into_offset_iter ( ) ;
1022
+ let p = Parser :: new_ext ( md, main_body_opts ( ) ) . into_offset_iter ( ) ;
1023
1023
1024
1024
// Treat inline HTML as plain text.
1025
1025
let p = p. map ( |event| match event. 0 {
@@ -1093,7 +1093,7 @@ fn markdown_summary_with_limit(
1093
1093
}
1094
1094
} ;
1095
1095
1096
- let p = Parser :: new_with_broken_link_callback ( md, opts ( ) , Some ( & mut replacer) ) ;
1096
+ let p = Parser :: new_with_broken_link_callback ( md, summary_opts ( ) , Some ( & mut replacer) ) ;
1097
1097
let mut p = LinkReplacer :: new ( p, link_names) ;
1098
1098
1099
1099
let mut buf = HtmlWithLimit :: new ( length_limit) ;
@@ -1240,7 +1240,8 @@ crate fn markdown_links(md: &str) -> Vec<MarkdownLink> {
1240
1240
} ) ;
1241
1241
None
1242
1242
} ;
1243
- let p = Parser :: new_with_broken_link_callback ( md, opts ( ) , Some ( & mut push) ) . into_offset_iter ( ) ;
1243
+ let p = Parser :: new_with_broken_link_callback ( md, main_body_opts ( ) , Some ( & mut push) )
1244
+ . into_offset_iter ( ) ;
1244
1245
1245
1246
// There's no need to thread an IdMap through to here because
1246
1247
// the IDs generated aren't going to be emitted anywhere.
@@ -1279,7 +1280,7 @@ crate fn rust_code_blocks(md: &str, extra_info: &ExtraInfo<'_>) -> Vec<RustCodeB
1279
1280
return code_blocks;
1280
1281
}
1281
1282
1282
- let mut p = Parser :: new_ext ( md, opts ( ) ) . into_offset_iter ( ) ;
1283
+ let mut p = Parser :: new_ext ( md, main_body_opts ( ) ) . into_offset_iter ( ) ;
1283
1284
1284
1285
while let Some ( ( event, offset) ) = p. next ( ) {
1285
1286
if let Event :: Start ( Tag :: CodeBlock ( syntax) ) = event {
0 commit comments