#[non_exhaustive]pub enum ErrorKind {
UnexpectedEof,
UnterminatedComment,
UnterminatedCdata,
UnterminatedTag,
StrayEndTag,
MismatchedEndTag,
ImplicitlyClosed,
UnknownEntity,
BogusComment,
}Expand description
The category of a ParseError.
Marked #[non_exhaustive]: new recovery cases may be added without it being
a breaking change, so always include a _ => arm when matching.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnexpectedEof
Input ended in the middle of a construct (tag, attribute, …).
UnterminatedComment
A <!-- comment was never closed with -->.
UnterminatedCdata
A <![CDATA[ section was never closed with ]]>.
UnterminatedTag
A tag was opened with < but never closed with >.
StrayEndTag
An end tag (</x>) had no matching open element in reach and was
ignored. An end tag reaches the 256 innermost open elements and the 8
outermost (so </body> still closes a deep pile of unclosed tags);
one whose element is open only in between is stray too, and that
element stays open — closed by a later end tag in reach or at the end
of the input. This keeps every end tag O(1) on any input.
MismatchedEndTag
An end tag closed elements other than the current one (mis-nesting).
Closing elements whose end tag is optional (</ul> over an open
<li>) is reported as ImplicitlyClosed
instead.
ImplicitlyClosed
An element was closed implicitly by another tag or end-of-input.
UnknownEntity
A reference-shaped &… was not recognised and was left verbatim: an
unknown &name;, a malformed &#…, or one of WHATWG’s legacy names
(&, ©, …) missing its ;. A bare & (as in a & b,
?a=1&b=2 or x&order=1) is valid HTML and not reported. The position
is that of the & (the first such one in a text run or attribute
value).
BogusComment
A <! ... > or <? ... > construct was treated as a bogus comment.