blob: 1538d113f51db0f0fa5dff020318c7affca4e0d7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
use color_eyre::{Result, eyre::Context};
use comrak::{ComrakOptions, Arena, parse_document, format_html, markdown_to_html};
pub fn render(inp: &str) -> Result<String> {
let mut options = ComrakOptions::default();
options.extension.autolink = true;
options.extension.table = true;
options.extension.description_lists = true;
options.extension.superscript = true;
options.extension.strikethrough = true;
options.extension.footnotes = true;
options.render.unsafe_ = true;
info!("{:?}", options.clone());
info!("{:?}", inp.clone());
Ok(markdown_to_html(inp, &options))
/*
let mut html = vec![];
format_html(root, &options, &mut html).unwrap();
info!("{:?}", String::from_utf8(html.clone()));
String::from_utf8(html).wrap_err("this is somehow not UTF-8")
*/
}
|