[Htmlparser-cvs] htmlparser/src/org/htmlparser NodeReader.java,1.28,1.29
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-05-24 21:04:47
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser In directory sc8-pr-cvs1:/tmp/cvs-serv7741/org/htmlparser Modified Files: NodeReader.java Log Message: Fixed bug #741769 ScriptScanner doesn't handle quoted </script> tags Major overhaul of ScriptScanner. It now uses the scan() method of CompositeTagScanner (i.e. doesn't override). CompositeTagScanner now has a balance_quotes member field that dictates whether strings tags are scanned honouring single and double quotes. This affected the call chain through NodeReader and StringScanner which now have this parameter. StringScanner now correctly handles quotes if asked. The ignoreState stuff is removed, it didn't work anyway since a single StringScanner is used recursively by the NodeReader, and the member field would have been tromped. Sorry to all those who have broken code because of this, but it's for the better. Really. Index: NodeReader.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/NodeReader.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** NodeReader.java 19 May 2003 02:49:56 -0000 1.28 --- NodeReader.java 24 May 2003 21:04:43 -0000 1.29 *************** *** 201,209 **** } ! /** * Read the next element * @return Node - The next node */ public Node readElement() throws ParserException { try { --- 201,221 ---- } ! /** * Read the next element * @return Node - The next node */ public Node readElement() throws ParserException + { + return (readElement (false)); + } + + /** + * Read the next element + * @param balance_quotes If <code>true</code> string nodes are parsed + * paying attention to single and double quotes, such that tag-like + * strings are ignored if they are quoted. + * @return Node - The next node + */ + public Node readElement(boolean balance_quotes) throws ParserException { try { *************** *** 262,266 **** else { ! node = stringParser.find(this,line,posInLine); if (node!=null) return node; } --- 274,278 ---- else { ! node = stringParser.find (this, line, posInLine, balance_quotes); if (node!=null) return node; } |