maud-pulldown-cmark release-badge docs-badge

This library implements an adapter to allow rendering strings as markdown inside a maud macro using pulldown-cmark efficiently.

Example

```rust let markdown = " 1. A list 2. With some 3. Values ";

let mut buffer = String::new();

html!(buffer, { div { $(markdown::from_string(markdown)) } });

println!("{}", buffer); ```

```rust let markdown = " 1. A list 2. With some 3. Inline html ";

let events = || Parser::new(markdown).map(|ev| match ev { // Escape inline html Event::Html(html) | Event::InlineHtml(html) => Event::Text(html), _ => ev, });

let mut buffer = String::new();

html!(buffer, { div { $(markdown::from_events(events)) } });

println!("{}", buffer); ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.