diff options
Diffstat (limited to 'gnu/javax/swing/text/html/parser/support/Parser.java')
-rw-r--r-- | gnu/javax/swing/text/html/parser/support/Parser.java | 14 |
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); + } } } |