This is such a PITA! The whitespace handling in the HTML parser now
sometimes consumed single characters, like the ':' in the japi pages.
This was caused by me screwing one condition. This is fixed now.

2006-11-16  Roman Kennke  <[EMAIL PROTECTED]>

        * gnu/javax/swing/text/html/parser/support/Parser.java
        (_handleText): Fixed condition for consuming whitespace.
        Removed validator check, this is superfluous now.

/Roman

Index: gnu/javax/swing/text/html/parser/support/Parser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/swing/text/html/parser/support/Parser.java,v
retrieving revision 1.12
diff -u -1 -5 -r1.12 Parser.java
--- gnu/javax/swing/text/html/parser/support/Parser.java	15 Nov 2006 21:45:32 -0000	1.12
+++ gnu/javax/swing/text/html/parser/support/Parser.java	16 Nov 2006 20:48:09 -0000
@@ -650,43 +650,39 @@
    * by the single one and the result is  moved into array,
    * passing it  to handleText().
    */
   protected void _handleText()
   {
     char[] text;
 
     if (preformatted > 0)
       text = textProcessor.preprocessPreformatted(buffer);
     else
       text = textProcessor.preprocess(buffer);
 
     if (text != null && text.length > 0
         // According to the specs we need to discard whitespace immediately
         // before a closing tag.
-        && (text.length > 1 || (text[0] == ' ' && ! TAG_CLOSE.matches(this))))
+        && (text.length > 1 || text[0] != ' ' || ! TAG_CLOSE.matches(this)))
       {
         TagElement pcdata = new TagElement(dtd.getElement("#pcdata"));
-        if ((text.length > 1 && text[0] != ' ')
-            || validator.tagIsValidForContext(pcdata) == Boolean.TRUE)
-          {
-            attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
-            _handleEmptyTag(pcdata);
+        attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
+        _handleEmptyTag(pcdata);
 
-            handleText(text);
-            if (titleOpen)
-              title.append(text);
-          }
+        handleText(text);
+        if (titleOpen)
+          title.append(text);
       }
   }
 
   /**
    * Add the image of this token to the buffer.
    * @param t A token to append.
    */
   protected final void append(Token t)
   {
     if (t.kind != EOF)
       t.appendTo(buffer);
   }
 
   /**
    * Consume pattern that must match.

Reply via email to