1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +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:
Daniel Veillard 2007-04-16 07:02:31 +00:00
parent 5657837103
commit 42720248e6
5 changed files with 35 additions and 74 deletions

View File

@ -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>
* xmlregexp.c: small enhancement for quantifier range with

View File

@ -2678,23 +2678,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
SHRINK;
cur = CUR_CHAR(l);
while (IS_CHAR_CH(cur)) {
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);
} 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) == '/')) {
if ((cur == '<') && (NXT(1) == '/')) {
/*
* One should break here, the specification is clear:
* Authors should therefore escape "</" within the content.

View File

@ -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("ype=html&size=100x90&url=http://www.goto.co");
document.write("m/d/search/ssn/&target=_blank&Partner=SSN80");
document.write("42DF8478957377></IFRAME>");
document.write("42DF8478957377>");
} else if ((parseInt(navigator.appVersion) > 3)
&& (navigator.appName == "Netscape")) {
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("ype=js&size=100x90&url=http://www.goto.com/");
document.write("d/search/ssn/&target=_blank&Partner=SSN8042");
document.write("DF8478957377></SC");
document.write("DF8478957377>");
document.write("RIPT>");
} else {
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("<IMG ismap ");
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">

View File

@ -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
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
</A></A></B><B></NOSCRIPT></B><B><!-- END GoTo.com Search Box --></B
^

View File

@ -39,30 +39,7 @@ SAX.ignorableWhitespace(
, 4)
SAX.startElement(script, language='JavaScript')
SAX.cdata(
, 1)
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)
&lt;!-- Idea by: Nic Wolfe (, 476)
SAX.endElement(script)
SAX.ignorableWhitespace(
@ -2715,37 +2692,19 @@ SAX.characters(
, 14)
SAX.startElement(script, language='javascript', type='text/javascript')
SAX.cdata(
, 9)
SAX.comment(
if ((parseInt(navigator.appVersion) >= 3)
&& (navigator.appName != "Netscape")) {
document.write("<IFRAME marginheight=0 frameborder=0 ");
document.write("marginwidth=0 scrolling=no width=100 height");
document.write("=90 ");
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
document.write("ype=html&size=100x90&url=http://www.goto.co");
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 ");
document.write("SRC=http://www.goto.com/d/ssn/dynconsole/?t");
document.write("ype=gif&size=100x90></A>");
&lt;!--
if ((, 532)
SAX.error: Unexpected end tag : iframe
SAX.cdata(");
} else if ((parseI, 463)
SAX.error: End tag : expected '>'
SAX.error: Unexpected end tag : sc
SAX.cdata(");
document.write("RI, 361)
SAX.error: Unexpected end tag : a
SAX.cdata(");
}
// )
SAX.cdata(
, 9)
// --, 37)
SAX.endElement(script)
SAX.characters(
, 14)