lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16952] New: - HTMLParser can't skip to parse some javascript code
Date Tue, 11 Feb 2003 03:54:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16952>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16952

HTMLParser can't skip to parse some javascript code

           Summary: HTMLParser can't skip to parse some javascript code
           Product: Lucene
           Version: 1.2
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Examples
        AssignedTo: lucene-dev@jakarta.apache.org
        ReportedBy: tommy.cheung@arontac.com


I found that org/apache/lucene/demo/html/HTMLParser.jj have a bug. I tried to 
parse the following HTML content:

	<script language="JavaScript">
	function preset() {
	var art_id=GetParamValue("art_id");
	//	alert("bbbb"+art_id);
	if(isNaN(art_id) || art_id=="") {
	    document.dymenu.article_id.selectedIndex=2;
	//	alert("aaaa");
	    return;
	}
	for(var i=1;i<document.dymenu.article_id.options.length;i++) {
	    if(document.dymenu.article_id.options[i].value==art_id) // line 625
	    break;
	    }
	document.dymenu.article_id.selectedIndex=i;
	return;
	}
	preset();
	</script></td></tr><tr><td align=right>
++++++++++++++++++++++++++++
it threw an exception:

adding ../projecthand/applenews2.html
Parse Aborted: Lexical error at line 625, column 60.  Encountered: "=" (61), 
after : ""

++++++++++++++++++++++++++++++

After i added comment tags "<!--" and "//-->" inside "<script>...</script>"

tags. it worked again. i think the HTMLParser should skip the javascript code 
without comment tags. Also i tried another javascript code block in the same 
file just before the above javascript code block and HTMLParser able to skip 
but still fail to parse the above javascript code block ....

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message