@@ -111,14 +111,9 @@ pub(crate) struct MarkdownWithToc<'a>(
111
111
pub ( crate ) Edition ,
112
112
pub ( crate ) & ' a Option < Playground > ,
113
113
) ;
114
- /// A tuple struct like `Markdown` that renders the markdown escaping HTML tags.
115
- pub ( crate ) struct MarkdownHtml < ' a > (
116
- pub ( crate ) & ' a str ,
117
- pub ( crate ) & ' a mut IdMap ,
118
- pub ( crate ) ErrorCodes ,
119
- pub ( crate ) Edition ,
120
- pub ( crate ) & ' a Option < Playground > ,
121
- ) ;
114
+ /// A tuple struct like `Markdown` that renders the markdown escaping HTML tags
115
+ /// and includes no paragraph tags.
116
+ pub ( crate ) struct MarkdownItemInfo < ' a > ( pub ( crate ) & ' a str , pub ( crate ) & ' a mut IdMap ) ;
122
117
/// A tuple struct like `Markdown` that renders only the first paragraph.
123
118
pub ( crate ) struct MarkdownSummaryLine < ' a > ( pub & ' a str , pub & ' a [ RenderedLink ] ) ;
124
119
@@ -1072,9 +1067,9 @@ impl MarkdownWithToc<'_> {
1072
1067
}
1073
1068
}
1074
1069
1075
- impl MarkdownHtml < ' _ > {
1070
+ impl MarkdownItemInfo < ' _ > {
1076
1071
pub ( crate ) fn into_string ( self ) -> String {
1077
- let MarkdownHtml ( md, ids, codes , edition , playground ) = self ;
1072
+ let MarkdownItemInfo ( md, ids) = self ;
1078
1073
1079
1074
// This is actually common enough to special-case
1080
1075
if md. is_empty ( ) {
@@ -1093,7 +1088,9 @@ impl MarkdownHtml<'_> {
1093
1088
let p = HeadingLinks :: new ( p, None , ids, HeadingOffset :: H1 ) ;
1094
1089
let p = Footnotes :: new ( p) ;
1095
1090
let p = TableWrapper :: new ( p. map ( |( ev, _) | ev) ) ;
1096
- let p = CodeBlocks :: new ( p, codes, edition, playground) ;
1091
+ let p = p. filter ( |event| {
1092
+ !matches ! ( event, Event :: Start ( Tag :: Paragraph ) | Event :: End ( Tag :: Paragraph ) )
1093
+ } ) ;
1097
1094
html:: push_html ( & mut s, p) ;
1098
1095
1099
1096
s
0 commit comments