1 //! Removes markdown from strings.
2 use pulldown_cmark::{Event, Parser, Tag};
4 /// Removes all markdown, keeping the text and code blocks
6 /// Currently limited in styling, i.e. no ascii tables or lists
7 pub(crate) fn remove_markdown(markdown: &str) -> String {
8 let mut out = String::new();
9 let parser = Parser::new(markdown);
13 Event::Text(text) | Event::Code(text) => out.push_str(&text),
14 Event::SoftBreak | Event::HardBreak | Event::Rule | Event::End(Tag::CodeBlock(_)) => {