• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HtmlEditorKit/HtmlDocument/HtmlReader problem

 
Aknod Algabar
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic