mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
html: Fix pull-parsing of incomplete end tags
Handle this HTML5 quirk in htmlParseEndTag.
This commit is contained in:
17
HTMLparser.c
17
HTMLparser.c
@ -3987,6 +3987,15 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
|
|||||||
|
|
||||||
SKIP(2);
|
SKIP(2);
|
||||||
|
|
||||||
|
if (ctxt->input->cur >= ctxt->input->end) {
|
||||||
|
htmlCheckParagraph(ctxt);
|
||||||
|
if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
|
||||||
|
(ctxt->sax->characters != NULL))
|
||||||
|
ctxt->sax->characters(ctxt->userData,
|
||||||
|
BAD_CAST "</", 2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (CUR == '>') {
|
if (CUR == '>') {
|
||||||
SKIP(1);
|
SKIP(1);
|
||||||
return;
|
return;
|
||||||
@ -5129,14 +5138,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case XML_PARSER_END_TAG:
|
case XML_PARSER_END_TAG:
|
||||||
if ((terminate) && (avail == 2)) {
|
|
||||||
htmlCheckParagraph(ctxt);
|
|
||||||
if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
|
|
||||||
(ctxt->sax->characters != NULL))
|
|
||||||
ctxt->sax->characters(ctxt->userData,
|
|
||||||
BAD_CAST "</", 2);
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
if ((!terminate) &&
|
if ((!terminate) &&
|
||||||
(htmlParseLookupGt(ctxt) < 0))
|
(htmlParseLookupGt(ctxt) < 0))
|
||||||
goto done;
|
goto done;
|
||||||
|
Reference in New Issue
Block a user