2017-10-28 15:26:01 +03:00
|
|
|
use pulldown_cmark::{Parser, html, OPTION_ENABLE_TABLES, OPTION_DISABLE_HTML};
|
2017-09-21 11:58:54 +03:00
|
|
|
|
|
|
|
pub fn render_markdown(src: &str) -> String {
|
2017-10-28 15:26:01 +03:00
|
|
|
let opts = OPTION_ENABLE_TABLES | OPTION_DISABLE_HTML;
|
|
|
|
let p = Parser::new_ext(src, opts);
|
2017-09-21 11:58:54 +03:00
|
|
|
let mut buf = String::new();
|
|
|
|
html::push_html(&mut buf, p);
|
|
|
|
buf
|
|
|
|
}
|