summaryrefslogtreecommitdiff
path: root/gnu/javax/swing/text
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-11-07 23:44:11 +0000
committerRoman Kennke <roman@kennke.org>2006-11-07 23:44:11 +0000
commit9512d2cd1b44773d7e5912f147592c9b556b7609 (patch)
tree3d52f93c2143974428496101692864fb664b9370 /gnu/javax/swing/text
parent4f3241a137dc71a22e4a172b53433cb91665cdf6 (diff)
downloadclasspath-9512d2cd1b44773d7e5912f147592c9b556b7609.tar.gz
2006-11-07 Roman Kennke <kennke@aicas.com>
* gnu/javax/swing/text/html/parser/support/Parser.java (_handleText): Check if text content is actually allowed before passing empty text fragments on to the parser callbacks.
Diffstat (limited to 'gnu/javax/swing/text')
-rw-r--r--gnu/javax/swing/text/html/parser/support/Parser.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/gnu/javax/swing/text/html/parser/support/Parser.java b/gnu/javax/swing/text/html/parser/support/Parser.java
index c2012faf8..f1f25fad0 100644
--- a/gnu/javax/swing/text/html/parser/support/Parser.java
+++ b/gnu/javax/swing/text/html/parser/support/Parser.java
@@ -662,12 +662,16 @@ public class Parser
if (text != null && text.length > 0)
{
TagElement pcdata = new TagElement(dtd.getElement("#pcdata"));
- attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
- _handleEmptyTag(pcdata);
+ if ((text.length > 1 && text[0] != ' ')
+ || validator.tagIsValidForContext(pcdata) == Boolean.TRUE)
+ {
+ attributes = htmlAttributeSet.EMPTY_HTML_ATTRIBUTE_SET;
+ _handleEmptyTag(pcdata);
- handleText(text);
- if (titleOpen)
- title.append(text);
+ handleText(text);
+ if (titleOpen)
+ title.append(text);
+ }
}
}