Function html2pango::block::markup_html_ignore_tags
source · pub fn markup_html_ignore_tags(
s: &str,
tags: &[&str]
) -> Result<Vec<HtmlBlock>, Error>
Expand description
Converts HTML body markup into a list of HTML blocks while ignoring some tags.
The provided tags are ignored while parsing as if they are not there, i.e. the parser just descends into them and leaves them out of the result.
For more details on what is actually converted, see the module documentation.
Errors
Returns an error if reading from the strings fails or if parsing somehow fails.
Examples
let blks =
markup_html_ignore_tags("<reply>this is <em>nice</em></reply>", &["body"]).unwrap();
assert_eq!(blks, vec![HtmlBlock::Text(String::from("this is <i>nice</i>"))]);
For more examples about the markup conversion, see markup_html
.