jotdown_wasm: add option to show events

provide 1:1 representation of events to help explore how events are
emitted
This commit is contained in:
Noah Hellman 2023-03-26 14:54:25 +02:00
parent f31398a796
commit f3732693c6
2 changed files with 18 additions and 4 deletions

View file

@ -12,3 +12,11 @@ pub fn jotdown_render(djot: &str) -> String {
.unwrap();
html
}
#[must_use]
#[wasm_bindgen]
pub fn jotdown_parse(djot: &str) -> String {
jotdown::Parser::new(djot)
.map(|e| format!("{:?}\n", e))
.collect()
}