We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc890ed commit bd7bf4aCopy full SHA for bd7bf4a
crates/ide/src/markdown_remove.rs
@@ -1,6 +1,6 @@
1
//! Removes markdown from strings.
2
3
-use pulldown_cmark::{Event, Parser};
+use pulldown_cmark::{Event, Parser, Tag};
4
5
/// Removes all markdown, keeping the text and code blocks
6
///
@@ -12,7 +12,9 @@ pub fn remove_markdown(markdown: &str) -> String {
12
for event in parser {
13
match event {
14
Event::Text(text) | Event::Code(text) => out.push_str(&text),
15
- Event::SoftBreak | Event::HardBreak | Event::Rule => out.push('\n'),
+ Event::SoftBreak | Event::HardBreak | Event::Rule | Event::End(Tag::CodeBlock(_)) => {
16
+ out.push('\n')
17
+ }
18
_ => {}
19
}
20
0 commit comments