///|
test "readme ParseError" {
let err = @core.ParseError(
"unexpected-null-character",
line=3,
column=14,
category="tokenizer",
)
debug_inspect(
err,
content=(
#|{
#| code: "unexpected-null-character",
#| line: Some(3),
#| column: Some(14),
#| category: "tokenizer",
#| message: "unexpected-null-character",
#|}
),
)
}///|
test "readme parser_error_category" {
debug_inspect(
(
@core.parser_error_category("unexpected-null-character"),
@core.parser_error_category("unexpected-end-tag"),
),
content=(
#|("tokenizer", "treebuilder")
),
)
}///|
pub(all) suberror HtmlError {
StrictMode(ParseError) // strict=true and parser found a diagnostic
InvalidSerialization(String) // tree could not be serialized
UnsafeHtml(String) // sanitizer found content it refused
SelectorError(String) // CSS selector failed to compile
}pub(all) suberror HtmlError {
StrictMode(ParseError)
InvalidSerialization(String)
UnsafeHtml(String)
SelectorError(String)
} derive(Eq, Debug)fn ParseError::ParseError(code : String, line? : Int, column? : Int, category? : String, message? : String) -> ParseError#deprecated("implicit derived-impl promotion; call the trait method directly")
fn ParseError::equal(ParseError, ParseError) -> Bool#deprecated("implicit derived-impl promotion; call the trait method directly")
fn ParseError::not_equal(x : ParseError, y : ParseError) -> Bool#deprecated("implicit derived-impl promotion; call the trait method directly")
fn ParseError::to_repr(ParseError) -> Reprfn parser_error_category(code : StringView) -> StringInstall
Download zipMoonBit HTML parser and sanitizer ported from JustHTML.
Dependencies