pub fn push_html<'a, I>(s: &mut String, iter: I)
Expand description
Iterate over an Iterator
of Event
s, generate HTML for each Event
, and
push it to a String
.
ยงExamples
use pulldown_cmark::{html, Parser};
let markdown_str = r#"
hello
=====
* alpha
* beta
"#;
let parser = Parser::new(markdown_str);
let mut html_buf = String::new();
html::push_html(&mut html_buf, parser);
assert_eq!(html_buf, r#"<h1>hello</h1>
<ul>
<li>alpha</li>
<li>beta</li>
</ul>
"#);