13 lines
417 B
Rust
13 lines
417 B
Rust
use wasm_bindgen::prelude::*;
|
|
|
|
#[wasm_bindgen]
|
|
pub fn render(md: &str) -> String {
|
|
let mut opts = pulldown_cmark::Options::empty();
|
|
opts.insert(pulldown_cmark::Options::ENABLE_TABLES);
|
|
let parser = pulldown_cmark::Parser::new_ext(md, opts);
|
|
let mut html = String::new();
|
|
pulldown_cmark::html::push_html(&mut html, parser);
|
|
html = html.replace("<table>", "<table class=\"table\">");
|
|
html
|
|
}
|