johannhof / markdown.rs

Rust Markdown parsing library
Apache License 2.0
136 stars 44 forks source link

Add generate_html to lib.rs #53

Open DSchroer opened 2 years ago

DSchroer commented 2 years ago

Adds generate_html to the library. Allowing the user to generate HTML from a Vec<Block>.

Right now my program has to:

let blocks = markdown::tokenize(input);
// modify blocks here
let md = markdown::generate_markdown(blocks);
return markdown::to_html(&md);

This would allow me to write it like this instead:

let blocks = markdown::tokenize(input);
// modify blocks here
return markdown::generate_html(blocks);