implement Render trait for html::Renderer
This commit is contained in:
parent
4743781cb9
commit
d7f2c0a819
5 changed files with 28 additions and 44 deletions
|
@ -1,10 +1,12 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use jotdown::Render;
|
||||
|
||||
#[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);
|
||||
jotdown::html::Renderer.push(events, &mut html).unwrap();
|
||||
html
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue