mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
change the way script/style are parsed to not try to detect comments,
* HTMLparser.c: change the way script/style are parsed to not try to detect comments, reported by Mike Day * result/HTML/doc3.*: affects the result of that test Daniel svn path=/trunk/; revision=3598
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Mon Apr 16 09:05:01 CEST 2007 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* HTMLparser.c: change the way script/style are parsed to
|
||||||
|
not try to detect comments, reported by Mike Day
|
||||||
|
* result/HTML/doc3.*: affects the result of that test
|
||||||
|
|
||||||
Wed Apr 11 22:38:18 HKT 2007 William Brack <wbrack@mmm.com.hk>
|
Wed Apr 11 22:38:18 HKT 2007 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
* xmlregexp.c: small enhancement for quantifier range with
|
* xmlregexp.c: small enhancement for quantifier range with
|
||||||
|
18
HTMLparser.c
18
HTMLparser.c
@ -2678,23 +2678,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
|
|||||||
SHRINK;
|
SHRINK;
|
||||||
cur = CUR_CHAR(l);
|
cur = CUR_CHAR(l);
|
||||||
while (IS_CHAR_CH(cur)) {
|
while (IS_CHAR_CH(cur)) {
|
||||||
if ((cur == '<') && (NXT(1) == '!') && (NXT(2) == '-') &&
|
if ((cur == '<') && (NXT(1) == '/')) {
|
||||||
(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);
|
|
||||||
} else if (ctxt->sax->characters != NULL) {
|
|
||||||
ctxt->sax->characters(ctxt->userData, buf, nbchar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nbchar = 0;
|
|
||||||
htmlParseComment(ctxt);
|
|
||||||
cur = CUR_CHAR(l);
|
|
||||||
continue;
|
|
||||||
} else if ((cur == '<') && (NXT(1) == '/')) {
|
|
||||||
/*
|
/*
|
||||||
* One should break here, the specification is clear:
|
* One should break here, the specification is clear:
|
||||||
* Authors should therefore escape "</" within the content.
|
* Authors should therefore escape "</" within the content.
|
||||||
|
@ -396,7 +396,7 @@ eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0,
|
|||||||
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
||||||
document.write("ype=html&size=100x90&url=http://www.goto.co");
|
document.write("ype=html&size=100x90&url=http://www.goto.co");
|
||||||
document.write("m/d/search/ssn/&target=_blank&Partner=SSN80");
|
document.write("m/d/search/ssn/&target=_blank&Partner=SSN80");
|
||||||
document.write("42DF8478957377></IFRAME>");
|
document.write("42DF8478957377>");
|
||||||
} else if ((parseInt(navigator.appVersion) > 3)
|
} else if ((parseInt(navigator.appVersion) > 3)
|
||||||
&& (navigator.appName == "Netscape")) {
|
&& (navigator.appName == "Netscape")) {
|
||||||
document.write("<SCRIPT language=javascript type=text/javas");
|
document.write("<SCRIPT language=javascript type=text/javas");
|
||||||
@ -404,7 +404,7 @@ eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0,
|
|||||||
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
||||||
document.write("ype=js&size=100x90&url=http://www.goto.com/");
|
document.write("ype=js&size=100x90&url=http://www.goto.com/");
|
||||||
document.write("d/search/ssn/&target=_blank&Partner=SSN8042");
|
document.write("d/search/ssn/&target=_blank&Partner=SSN8042");
|
||||||
document.write("DF8478957377></SC");
|
document.write("DF8478957377>");
|
||||||
document.write("RIPT>");
|
document.write("RIPT>");
|
||||||
} else {
|
} else {
|
||||||
document.write("<A TARGET=_blank ");
|
document.write("<A TARGET=_blank ");
|
||||||
@ -412,7 +412,7 @@ eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0,
|
|||||||
document.write("GIF=true>");
|
document.write("GIF=true>");
|
||||||
document.write("<IMG ismap ");
|
document.write("<IMG ismap ");
|
||||||
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
||||||
document.write("ype=gif&size=100x90></A>");
|
document.write("ype=gif&size=100x90>");
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
</script><b><noscript></noscript></b><a href="http://www.goto.com/d/search/ssn/?fromGIF=true" target="_blank"><img align="bottom" border="0" height="90" ismap src="doc3_files/100x90.gif" width="100"></a><b><a href="http://www.goto.com/d/search/ssn/?fromGIF=true" target="_blank">
|
</script><b><noscript></noscript></b><a href="http://www.goto.com/d/search/ssn/?fromGIF=true" target="_blank"><img align="bottom" border="0" height="90" ismap src="doc3_files/100x90.gif" width="100"></a><b><a href="http://www.goto.com/d/search/ssn/?fromGIF=true" target="_blank">
|
||||||
|
@ -40,6 +40,18 @@ om/ad_static.asp?pid=2097&sid=1881&asid=7708"></a></IFRAME></CENTER></LI></FONT>
|
|||||||
./test/HTML/doc3.htm:772: HTML parser error : Unexpected end tag : form
|
./test/HTML/doc3.htm:772: HTML parser error : Unexpected end tag : form
|
||||||
archive</A></FONT> </FORM></CENTER></TD></TR></TBODY></TABLE><!--
|
archive</A></FONT> </FORM></CENTER></TD></TR></TBODY></TABLE><!--
|
||||||
^
|
^
|
||||||
|
./test/HTML/doc3.htm:795: HTML parser error : Unexpected end tag : iframe
|
||||||
|
document.write("42DF8478957377></IFRAME>");
|
||||||
|
^
|
||||||
|
./test/HTML/doc3.htm:803: HTML parser error : End tag : expected '>'
|
||||||
|
document.write("DF8478957377></SC");
|
||||||
|
^
|
||||||
|
./test/HTML/doc3.htm:803: HTML parser error : Unexpected end tag : sc
|
||||||
|
document.write("DF8478957377></SC");
|
||||||
|
^
|
||||||
|
./test/HTML/doc3.htm:811: HTML parser error : Unexpected end tag : a
|
||||||
|
document.write("ype=gif&size=100x90></A>");
|
||||||
|
^
|
||||||
./test/HTML/doc3.htm:820: HTML parser error : Unexpected end tag : a
|
./test/HTML/doc3.htm:820: HTML parser error : Unexpected end tag : a
|
||||||
</A></A></B><B></NOSCRIPT></B><B><!-- END GoTo.com Search Box --></B
|
</A></A></B><B></NOSCRIPT></B><B><!-- END GoTo.com Search Box --></B
|
||||||
^
|
^
|
||||||
|
@ -39,30 +39,7 @@ SAX.ignorableWhitespace(
|
|||||||
, 4)
|
, 4)
|
||||||
SAX.startElement(script, language='JavaScript')
|
SAX.startElement(script, language='JavaScript')
|
||||||
SAX.cdata(
|
SAX.cdata(
|
||||||
, 1)
|
<!-- Idea by: Nic Wolfe (, 476)
|
||||||
SAX.comment( Idea by: Nic Wolfe (Nic@TimelapseProductions.com) )
|
|
||||||
SAX.cdata(
|
|
||||||
, 1)
|
|
||||||
SAX.comment( Web URL: http://fineline.xs.mw )
|
|
||||||
SAX.cdata(
|
|
||||||
|
|
||||||
, 2)
|
|
||||||
SAX.comment( This script and many more are available free online at )
|
|
||||||
SAX.cdata(
|
|
||||||
, 1)
|
|
||||||
SAX.comment( The JavaScript Source!! http://javascript.internet.com )
|
|
||||||
SAX.cdata(
|
|
||||||
|
|
||||||
, 2)
|
|
||||||
SAX.comment( Begin
|
|
||||||
function popUp(URL) {
|
|
||||||
day = new Date();
|
|
||||||
id = day.getTime();
|
|
||||||
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0, location=0, statusbars=0, menubars=0, resizable=0, width=145, height=250');");
|
|
||||||
}
|
|
||||||
// End )
|
|
||||||
SAX.cdata(
|
|
||||||
, 1)
|
|
||||||
SAX.endElement(script)
|
SAX.endElement(script)
|
||||||
SAX.ignorableWhitespace(
|
SAX.ignorableWhitespace(
|
||||||
|
|
||||||
@ -2715,37 +2692,19 @@ SAX.characters(
|
|||||||
SAX.comment( BEGIN GoTo.com Search Box )
|
SAX.comment( BEGIN GoTo.com Search Box )
|
||||||
SAX.characters(
|
SAX.characters(
|
||||||
, 14)
|
, 14)
|
||||||
SAX.startElement(script, language='javascript', type='text/javascript')
|
SAX.startElement(script, language='javascript', type='text/javascript')
|
||||||
SAX.cdata(
|
SAX.cdata(
|
||||||
, 9)
|
<!--
|
||||||
SAX.comment(
|
if ((, 532)
|
||||||
if ((parseInt(navigator.appVersion) >= 3)
|
SAX.error: Unexpected end tag : iframe
|
||||||
&& (navigator.appName != "Netscape")) {
|
SAX.cdata(");
|
||||||
document.write("<IFRAME marginheight=0 frameborder=0 ");
|
} else if ((parseI, 463)
|
||||||
document.write("marginwidth=0 scrolling=no width=100 height");
|
SAX.error: End tag : expected '>'
|
||||||
document.write("=90 ");
|
SAX.error: Unexpected end tag : sc
|
||||||
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
SAX.cdata(");
|
||||||
document.write("ype=html&size=100x90&url=http://www.goto.co");
|
document.write("RI, 361)
|
||||||
document.write("m/d/search/ssn/&target=_blank&Partner=SSN80");
|
|
||||||
document.write("42DF8478957377></IFRAME>");
|
|
||||||
} else if ((parseInt(navigator.appVersion) > 3)
|
|
||||||
&& (navigator.appName == "Netscape")) {
|
|
||||||
document.write("<SCRIPT language=javascript type=text/javas");
|
|
||||||
document.write("cript ");
|
|
||||||
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
|
|
||||||
document.write("ype=js&size=100x90&url=http://www.goto.com/");
|
|
||||||
document.write("d/search/ssn/&target=_blank&Partner=SSN8042");
|
|
||||||
document.write("DF8478957377></SC");
|
|
||||||
document.write("RIPT>");
|
|
||||||
} else {
|
|
||||||
document.write("<A TARGET=_blank ");
|
|
||||||
document.write("HREF=http://www.goto.com/d/search/ssn/?from");
|
|
||||||
document.write("GIF=true>");
|
|
||||||
document.write("<IMG ismap ");
|
|
||||||
SAX.error: Unexpected end tag : a
|
SAX.error: Unexpected end tag : a
|
||||||
document.write("ype=gif&size=100x90></A>");
|
SAX.cdata(");
|
||||||
}
|
|
||||||
// )
|
|
||||||
}
|
}
|
||||||
// --, 37)
|
// --, 37)
|
||||||
SAX.endElement(script)
|
SAX.endElement(script)
|
||||||
|
Reference in New Issue
Block a user