examples: add wasm online demo
This commit is contained in:
parent
908ba72812
commit
5a882764f7
7 changed files with 182 additions and 0 deletions
10
examples/jotdown_wasm/src/lib.rs
Normal file
10
examples/jotdown_wasm/src/lib.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue