use color_eyre::{Result, eyre::Context}; use comrak::{ComrakOptions, Arena, parse_document, format_html}; pub fn render(inp: &str) -> Result { let mut options = ComrakOptions::default(); options.extension.autolink = true; options.extension.table = true; options.extension.superscript = true; options.extension.footnotes = true; options.render.unsafe_ = true; let arena = Arena::new(); let root = parse_document(&arena, inp, &options); let mut html = vec![]; format_html(root, &options, &mut html).unwrap(); String::from_utf8(html).wrap_err("this is somehow not UTF-8") }