1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

html: Ignore unexpected DOCTYPE declarations

This commit is contained in:
Nick Wellnhofer
2024-09-11 19:47:07 +02:00
parent 462bf0b7a5
commit be874d7831
2 changed files with 5 additions and 2 deletions

View File

@ -4343,6 +4343,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
(UPP(4) == 'C') && (UPP(5) == 'T') &&
(UPP(6) == 'Y') && (UPP(7) == 'P') &&
(UPP(8) == 'E')) {
ctxt->instate = XML_PARSER_MISC;
htmlParseDocTypeDecl(ctxt);
}
SKIP_BLANKS;
@ -4350,6 +4351,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
/*
* Parse possible comments and PIs before any content
*/
ctxt->instate = XML_PARSER_PROLOG;
while (CUR == '<') {
if ((NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) {
SKIP(4);
@ -4366,6 +4368,7 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
/*
* Time to start parsing the tree itself
*/
ctxt->instate = XML_PARSER_CONTENT;
htmlParseContent(ctxt);
/*