1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-16 07:21:58 +03:00

fix comment in scripts element parsing. updated the results. Daniel

* HTMLparser.c: fix comment in scripts element parsing.
* result/HTML/doc3*: updated the results.
Daniel
This commit is contained in:
Daniel Veillard
2001-11-10 11:43:05 +00:00
parent c6e013ab52
commit c1f78343b6
5 changed files with 100 additions and 29 deletions

View File

@ -53,6 +53,7 @@ static int htmlOmittedDefaultValue = 1;
xmlChar * htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
xmlChar end, xmlChar end2, xmlChar end3);
static void htmlParseComment(htmlParserCtxtPtr ctxt);
/************************************************************************
* *
@ -2299,7 +2300,21 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
SHRINK;
cur = CUR;
while (IS_CHAR(cur)) {
if ((cur == '<') && (NXT(1) == '/')) {
if ((cur == '<') && (NXT(1) == '!') && (NXT(2) == '-') &&
(NXT(3) == '-')) {
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
if (ctxt->sax->cdataBlock!= NULL) {
/*
* Insert as CDATA, which is the same as HTML_PRESERVE_NODE
*/
ctxt->sax->cdataBlock(ctxt->userData, buf, nbchar);
}
}
nbchar = 0;
htmlParseComment(ctxt);
cur = CUR;
continue;
} else if ((cur == '<') && (NXT(1) == '/')) {
/*
* One should break here, the specification is clear:
* Authors should therefore escape "</" within the content.
@ -3841,6 +3856,7 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
int base, len;
htmlParserInputPtr in;
const xmlChar *buf;
int incomment = 0;
in = ctxt->input;
if (in == NULL) return(-1);
@ -3859,6 +3875,23 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
if (third) len -= 2;
else if (next) len --;
for (;base < len;base++) {
if (!incomment && (base + 4 < len)) {
if ((buf[base] == '<') && (buf[base + 1] == '!') &&
(buf[base + 2] == '-') && (buf[base + 3] == '-')) {
incomment = 1;
}
/* do not increment base, some people use <!--> */
}
if (incomment) {
if (base + 3 < len)
return(-1);
if ((buf[base] == '-') && (buf[base + 1] == '-') &&
(buf[base + 2] == '>')) {
incomment = 0;
base += 2;
}
continue;
}
if (buf[base] == first) {
if (third != 0) {
if ((buf[base + 1] != next) ||