Struct html_sanitizer::TagParser [−][src]
pub struct TagParser { /* fields omitted */ }
Create a tag parser.
The tag parser is responsible for parsing the tag and walking through the nodes in the HTML document.
let mut parser = TagParser::new(&mut input); parser.walk(|tag| { // Do something with `tag` here });
Methods
impl TagParser
[src]
impl TagParser
pub fn new<A>(input: &mut A) -> Self where
A: Read + Sized,
[src]
pub fn new<A>(input: &mut A) -> Self where
A: Read + Sized,
Create a new tagparser with any Read source.
Suggested read targets are std::fs::File
and std::io::BufReader
.
pub fn walk<F>(&mut self, callback: F) -> String where
F: Fn(&mut Tag),
[src]
pub fn walk<F>(&mut self, callback: F) -> String where
F: Fn(&mut Tag),
Recursively walk through all the HTML nodes, calling callback
for each tag.