pub fn write_html_fmt<'a, I, W>(writer: W, iter: I) -> Result
Expand description
Iterate over an Iterator
of Event
s, generate HTML for each Event
, and
write it into Unicode-accepting buffer or stream.
ยงExamples
use pulldown_cmark::{html, Parser};
let markdown_str = r#"
hello
=====
* alpha
* beta
"#;
let mut buf = String::new();
let parser = Parser::new(markdown_str);
html::write_html_fmt(&mut buf, parser);
assert_eq!(buf, r#"<h1>hello</h1>
<ul>
<li>alpha</li>
<li>beta</li>
</ul>
"#);