[Htmlparser-cvs] htmlparser/src/org/htmlparser/tags ScriptTag.java,1.36,1.37
Brought to you by:
derrickoswald
From: <der...@us...> - 2004-02-29 01:56:19
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19426 Modified Files: ScriptTag.java Log Message: Correct booboo in ScriptTag toHtml() injected by fix to bug #902121. Index: ScriptTag.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tags/ScriptTag.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ScriptTag.java 28 Feb 2004 15:52:43 -0000 1.36 --- ScriptTag.java 29 Feb 2004 01:38:36 -0000 1.37 *************** *** 27,31 **** --- 27,33 ---- package org.htmlparser.tags; + import org.htmlparser.Node; import org.htmlparser.scanners.ScriptScanner; + import org.htmlparser.util.SimpleNodeIterator; /** *************** *** 136,161 **** } ! /** ! * Render the tag as HTML. ! * @return The tag as an HTML fragment. ! * @see org.htmlparser.Node#toHtml() ! */ ! public String toHtml() { ! StringBuffer ret; ! ! ret = new StringBuffer (); ! ret.append (super.toHtml ()); ! if (!isEmptyXmlTag ()) ! { ! if (null != getScriptCode ()) ! ret.append (getScriptCode ()); ! else ! putChildrenInto (ret); ! if (null != getEndTag ()) ! putEndTagInto (ret); ! } ! return (ret.toString()); } --- 138,155 ---- } ! protected void putChildrenInto(StringBuffer sb) { ! Node node; ! if (null != getScriptCode ()) ! sb.append (getScriptCode ()); ! else ! for (SimpleNodeIterator e = children (); e.hasMoreNodes ();) ! { ! node = e.nextNode (); ! // eliminate virtual tags ! // if (!(node.getStartPosition () == node.getEndPosition ())) ! sb.append (node.toHtml ()); ! } } |