[Htmlparser-cvs] htmlparser/src/org/htmlparser/beans StringBean.java,1.37,1.38
Brought to you by:
derrickoswald
From: <der...@us...> - 2004-02-28 16:10:06
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv977/beans Modified Files: StringBean.java Log Message: Fix bug #902121 StringBean throws NullPointerException. Added ScriptDecoder to handle Microsoft Script Encoder encrypted tags. Added accessor to ScriptTag's scriptCode property to be able to override it. Ensured that a Tag always has a non-null name. Skip STYLE tags in StringBean, just like SCRIPT. Index: StringBean.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/StringBean.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** StringBean.java 11 Feb 2004 12:37:59 -0000 1.37 --- StringBean.java 28 Feb 2004 15:52:42 -0000 1.38 *************** *** 162,165 **** --- 162,170 ---- /** + * Set <code>true</code> when traversing a STYLE tag. + */ + protected boolean mIsStyle; + + /** * Create a StringBean object. * Default property values are set to 'do the right thing': *************** *** 185,188 **** --- 190,194 ---- mIsScript = false; mIsPre = false; + mIsStyle = false; } *************** *** 322,325 **** --- 328,332 ---- mIsPre = false; mIsScript = false; + mIsStyle = false; try { // try again with the encoding now in force *************** *** 616,620 **** public void visitStringNode (StringNode string) { ! if (!mIsScript) { String text = string.getText (); --- 623,627 ---- public void visitStringNode (StringNode string) { ! if (!mIsScript && !mIsStyle) { String text = string.getText (); *************** *** 647,650 **** --- 654,659 ---- else if (name.equalsIgnoreCase ("SCRIPT")) mIsScript = true; + else if (name.equalsIgnoreCase ("STYLE")) + mIsStyle = true; if (tag.breaksFlow ()) carriage_return (); *************** *** 664,667 **** --- 673,678 ---- else if (name.equalsIgnoreCase ("SCRIPT")) mIsScript = false; + else if (name.equalsIgnoreCase ("STYLE")) + mIsStyle = false; } |