Skip to content

Commit c09549a

Browse files
committed
Avoid panic when displaying unexpected token error
Avoid entering unreachable!() when displaying an error message for an invalid `<!` token. This fixes a panic when processing a malformed XML which contains such token in an unexpected place, like the following: `<!DOCTYPEs/%<!A`
1 parent 563f975 commit c09549a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/reader/lexer.rs

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ impl fmt::Display for Token {
8181
Token::EqualsSign => "=",
8282
Token::SingleQuote => "'",
8383
Token::DoubleQuote => "\"",
84+
Token::MarkupDeclarationStart => "<!",
8485
_ => unreachable!()
8586
}.fmt(f),
8687
}

0 commit comments

Comments
 (0)