Skip to main content

parse_html_with_options

Function parse_html_with_options 

Source
pub fn parse_html_with_options(
    input: &str,
    options: &HtmlParseOptions,
) -> Result<Document, ParseError>
Expand description

Parses an HTML string into a Document with the given options.

§Errors

Returns ParseError if the input cannot be parsed and recovery mode is disabled.

§Examples

use xmloxide::html::{parse_html_with_options, HtmlParseOptions};

let opts = HtmlParseOptions::default().no_blanks(true);
let doc = parse_html_with_options("<html><body><p>Hi</p></body></html>", &opts).unwrap();