Forums Register Login

HtmlEditorKit/HtmlDocument/HtmlReader problem

+Pie Number of slices to send: Send
Hello,

Using JTextPane editing HTML in my application I found that HtmlReader (probably) ignores/removes empty paragraphs... For example, loading the following HTML code

<html>
<head>

</head>
<body>
<p style="margin-top: 0">

</p>
</body>
</html>

causes something like that

<html>
<head>

</head>
<body>
</body>
</html>

Also it ignores/removes table cells with empty paragraph elements inside. It is interesting that it removes only one element per getText/setText iteration.

This unwanted removing of empty elements causes a lot of headache during editing, etc.

I appreciate any comments and suggestions how to fix it.

Thank you,

Alex
It's feeding time! Give me the food you were going to give to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1122 times.
Similar Threads
PriorityBlockingQueue and concurrent access
Struts templates
JSP not being generated properly with SAX
Html page doesn't include styles,given in document.
jsp:usebean not working
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 02:12:28.