I try to parse the following HTML source code:
<a href="./">Home</a>
<a href="http://gouessej.wordpress.com/tag/tuer/">Blog</a>
I implement the interface org.jsoup.select.NodeVisitor
. However, it seems to skip the content between </a>
and <a
. Disabling the pretty printing doesn't solve my problem.
You can run the first JUnit test to reproduce this bug: https://github.com/gouessej/HtmlFlow/blob/patch-1/src/test/java/htmlflow/flowifier/test/TestFlowifier.java It converts the HTML source code of my homepage into Java source code, it converts this Java source code back to HTML and it compares the resulting HTML source code to the original source code.
P.S: Actually TextNode.getWholeText()
returns \n
instead of \n
.
TextNode.getWholeText()
returns some unescaped text, I just need to escape it by calling Entities.escape(TextNode.getWholeText())
.