-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should wholeText() introduce newlines between block elements? #2083
Comments
This is "as designed" currently - wholeText gets only the non-normalized text values from the elements. I have considered changing it to emit a newline when encountering a new block tag as that seems more useful.
Would be good to hear opinions from folks on this. It seems safe and information preserving. |
use br Tag |
I tried to use wholeText() as a way to convert html to text, but it doesn't really work... and text() is even worse... Is there any other command that could be used to convert html content into text that produces better results? |
@h920526 For your case I think you need to wrap your text into html tags, I needed to do that, so something like this:
|
@jhy It might be useful to have command so that it can be converted to text. At the moment wholeText does this, but there are problems, see 1st message. |
Hi team,
Jsoup v1.16.1
after calling wholeText()
expected:
Hello
World
but actual:
HelloWorld
does not wrap with new line
thanks
The text was updated successfully, but these errors were encountered: