jotdown/examples/jotdown_wasm/src/lib.rs
2023-02-05 20:41:59 +01:00

10 lines
239 B
Rust

use wasm_bindgen::prelude::*;
#[must_use]
#[wasm_bindgen]
pub fn jotdown_render(djot: &str) -> String {
let events = jotdown::Parser::new(djot);
let mut html = String::new();
jotdown::html::push(events, &mut html);
html
}