pub fn render_plaintext(ast: &Document, config: Config) -> StringExpand description
Render a Markdown AST to plain text, stripping all formatting
§Arguments
ast- The Markdown document AST to renderconfig- Configuration options controlling the output
§Returns
A String containing the plain text
§Examples
use markdown_ppp::ast::*;
use markdown_ppp::plaintext_printer::{render_plaintext, config::Config};
let doc = Document {
blocks: vec![Block::Paragraph(vec![
Inline::Text("Hello ".to_string()),
Inline::Strong(vec![Inline::Text("world".to_string())]),
])],
};
let text = render_plaintext(&doc, Config::default());
assert_eq!(text, "Hello world");