1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 19:04:59 +00:00

LibHTML: Ignore case in <!DOCTYPE> tags :^)

This commit is contained in:
Andreas Kling 2019-11-07 21:39:15 +01:00
parent 71f249fd2c
commit 0355146af9

View file

@ -168,13 +168,13 @@ static bool parse_html_document(const StringView& html, Document& document, Pare
break;
}
if (ch == '!') {
if (peek(1) == 'D'
&& peek(2) == 'O'
&& peek(3) == 'C'
&& peek(4) == 'T'
&& peek(5) == 'Y'
&& peek(6) == 'P'
&& peek(7) == 'E') {
if (toupper(peek(1)) == 'D'
&& toupper(peek(2)) == 'O'
&& toupper(peek(3)) == 'C'
&& toupper(peek(4)) == 'T'
&& toupper(peek(5)) == 'Y'
&& toupper(peek(6)) == 'P'
&& toupper(peek(7)) == 'E') {
i += 7;
move_to_state(State::InDoctype);
break;