aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ide/src/markdown_remove.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ide/src/markdown_remove.rs b/crates/ide/src/markdown_remove.rs
index ea12cf0fc..02ad39dfb 100644
--- a/crates/ide/src/markdown_remove.rs
+++ b/crates/ide/src/markdown_remove.rs
@@ -1,6 +1,6 @@
1//! Removes markdown from strings. 1//! Removes markdown from strings.
2 2
3use pulldown_cmark::{Event, Parser}; 3use pulldown_cmark::{Event, Parser, Tag};
4 4
5/// Removes all markdown, keeping the text and code blocks 5/// Removes all markdown, keeping the text and code blocks
6/// 6///
@@ -12,7 +12,9 @@ pub fn remove_markdown(markdown: &str) -> String {
12 for event in parser { 12 for event in parser {
13 match event { 13 match event {
14 Event::Text(text) | Event::Code(text) => out.push_str(&text), 14 Event::Text(text) | Event::Code(text) => out.push_str(&text),
15 Event::SoftBreak | Event::HardBreak | Event::Rule => out.push('\n'), 15 Event::SoftBreak | Event::HardBreak | Event::Rule | Event::End(Tag::CodeBlock(_)) => {
16 out.push('\n')
17 }
16 _ => {} 18 _ => {}
17 } 19 }
18 } 20 }