@@ -48,15 +48,15 @@ use pulldown_cmark::{
4848mod tests;
4949
5050/// Options for rendering Markdown in the main body of documentation.
51- pub ( crate ) fn opts ( ) -> Options {
51+ pub ( crate ) fn main_body_opts ( ) -> Options {
5252 Options :: ENABLE_TABLES
5353 | Options :: ENABLE_FOOTNOTES
5454 | Options :: ENABLE_STRIKETHROUGH
5555 | Options :: ENABLE_TASKLISTS
5656 | Options :: ENABLE_SMART_PUNCTUATION
5757}
5858
59- /// A subset of [`opts ()`] used for rendering summaries.
59+ /// A subset of [`main_body_opts ()`] used for rendering summaries.
6060pub ( crate ) fn summary_opts ( ) -> Options {
6161 Options :: ENABLE_STRIKETHROUGH | Options :: ENABLE_SMART_PUNCTUATION | Options :: ENABLE_TABLES
6262}
@@ -975,7 +975,7 @@ impl Markdown<'_> {
975975 }
976976 } ;
977977
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) ) ;
979979 let p = p. into_offset_iter ( ) ;
980980
981981 let mut s = String :: with_capacity ( md. len ( ) * 3 / 2 ) ;
@@ -994,7 +994,7 @@ impl MarkdownWithToc<'_> {
994994 crate fn into_string ( self ) -> String {
995995 let MarkdownWithToc ( md, mut ids, codes, edition, playground) = self ;
996996
997- let p = Parser :: new_ext ( md, opts ( ) ) . into_offset_iter ( ) ;
997+ let p = Parser :: new_ext ( md, main_body_opts ( ) ) . into_offset_iter ( ) ;
998998
999999 let mut s = String :: with_capacity ( md. len ( ) * 3 / 2 ) ;
10001000
@@ -1019,7 +1019,7 @@ impl MarkdownHtml<'_> {
10191019 if md. is_empty ( ) {
10201020 return String :: new ( ) ;
10211021 }
1022- let p = Parser :: new_ext ( md, opts ( ) ) . into_offset_iter ( ) ;
1022+ let p = Parser :: new_ext ( md, main_body_opts ( ) ) . into_offset_iter ( ) ;
10231023
10241024 // Treat inline HTML as plain text.
10251025 let p = p. map ( |event| match event. 0 {
@@ -1093,7 +1093,7 @@ fn markdown_summary_with_limit(
10931093 }
10941094 } ;
10951095
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) ) ;
10971097 let mut p = LinkReplacer :: new ( p, link_names) ;
10981098
10991099 let mut buf = HtmlWithLimit :: new ( length_limit) ;
@@ -1240,7 +1240,8 @@ crate fn markdown_links(md: &str) -> Vec<MarkdownLink> {
12401240 } ) ;
12411241 None
12421242 } ;
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 ( ) ;
12441245
12451246 // There's no need to thread an IdMap through to here because
12461247 // 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
12791280 return code_blocks;
12801281 }
12811282
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 ( ) ;
12831284
12841285 while let Some ( ( event, offset) ) = p. next ( ) {
12851286 if let Event :: Start ( Tag :: CodeBlock ( syntax) ) = event {
0 commit comments