0

I have a webview in javafx. When a I put a HTML source code into the webview, the source code is rearranged. After getting the rearranged source code from the webview, I can experience the changes. For example the auto p tag rearranging :

The original source is:

<p>
Hello<br>
<p>This is the second line</p>
Third..
</p>

And the rearranged source if I retrieve it..

<p>
Hello<br>
</p>
<p>This is the second line</p>
Third..
<p></p>

The example shows that I do not have a p tag inside a p tag, because the webview rearrange the source code.

The question is that :

How can I turn off the auto p rearranging in the javafx webview?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • 1
    Paragraphs cannot be nested. Any paragraph is automatically closed before the next paragraph is opened, even if the html document has a different structure. Since the result of parsing is stored in a dom tree and issues like these in your document automatically result in the correct structure, you cannot go back to the original "incorrect" document structure. See also https://stackoverflow.com/questions/12015804/nesting-p-wont-work-while-nesting-div-will – fabian Jul 31 '19 at 08:54
  • Thx ! Does it depends on the browser phraser? It a bit freaky that I give a valid code to the browser, and it modifies to a maddness as a crazy world wide. – user3492499 Jul 31 '19 at 15:05

0 Answers0