]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/markdown.rs
Auto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726
[rust.git] / src / librustdoc / html / markdown.rs
index ec2e129c364e80e25a4885049e23c102eb2671ec..43d07d4a53337ae6100fdfb9c7ac53b745bb810e 100644 (file)
@@ -1119,7 +1119,11 @@ pub(crate) fn into_string(self) -> String {
 
         let mut s = String::new();
 
-        html::push_html(&mut s, LinkReplacer::new(SummaryLine::new(p), links));
+        let without_paragraphs = LinkReplacer::new(SummaryLine::new(p), links).filter(|event| {
+            !matches!(event, Event::Start(Tag::Paragraph) | Event::End(Tag::Paragraph))
+        });
+
+        html::push_html(&mut s, without_paragraphs);
 
         s
     }