4

I have a file, containing czech text common file split to two lines:

<html>
<head>
    <meta http-equiv="contet-type" content="text/html; charset=UTF-8"/>
</head>
<body>
    <p>Běžný</p>
    <p>soubor</p>
</body>
</html>

When I load this file to JEditorPane using HTMLEditorKit and then save it (like having it edited), the underlying model (HTML code) is changed to:

<html>
<head>
    <meta http-equiv="contet-type" content="text/html; charset=UTF-8"/>
</head>
<body>
    <p style="margin-top: 0">B&#283;&#382;n&#253;</p>
    <p style="margin-top: 0">soubor</p>
</body>
</html>

Is there some way to get out of margins and entities? Must I inevitably override some methods of HMLEditorKit?

PS: Is there some another embedable (and free) simple Java HTML (WYSIWYG-like) editor? But I need to handle some special tags from my own XML-namespace. (Ideally HTML 4.0 compliant.)

Theodor Keinstein
  • 1,653
  • 2
  • 26
  • 47
  • check this questions::: http://stackoverflow.com/questions/4164991/using-shy-in-java-html-aware-component – Samir Mangroliya Sep 15 '11 at 18:12
  • I thing, Christian Kuetbacch has a problem with rendering of an existing HTML containing entities. But I have problem with unwanted translation of diacritical characters to entities. I don't want to display sophisticated HTML. I just need a simple editor to put heading, paragraphs and eventually tables. The `HTMLEditorKit` should be powerful enought. Unfortunately it is so bad implemented, that it seems unusable either for such a simple task. The class does support HTML 4.0 neither in Java 6 nor in incoming Java 7. (The bug is reported since 1999!) – Theodor Keinstein Sep 16 '11 at 05:45

1 Answers1

0

Please use Net Beans IDE 7.0.

Downloads free http://netbeans.org/downloads/

Jayanath
  • 220
  • 1
  • 2
  • 8
  • Sorry, I forgot the most important: I don't need to edit the HTML code, the HTML code is behind. It should be simple editor, where the user writes regular text using just italic, bold, headings, lists and tables (so simple HTML without special formatting). – Theodor Keinstein Sep 16 '11 at 19:13