Skip to content
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

Adds a line break on cleaning the text for the u tag #851

Closed
coded9 opened this issue Mar 24, 2017 · 5 comments
Closed

Adds a line break on cleaning the text for the u tag #851

coded9 opened this issue Mar 24, 2017 · 5 comments
Labels
bug Confirmed bug that we should fix
Milestone

Comments

@coded9
Copy link

coded9 commented Mar 24, 2017

String msg = "t<u>es</u>t <b>on</b> <i>f</i><u>ir</u>e";
msg = Jsoup.clean(msg, Whitelist.simpleText());
System.out.println(msg);

Output:

t
<u>es</u>t 
<b>on</b> 
<i>f</i>
<u>ir</u>e

@cketti
Copy link
Contributor

cketti commented Mar 24, 2017

Seems to be a bug in the pretty print code. Simply parsing the HTML fragment and outputting it with pretty print enabled will lead to the same result.

@coded9
Copy link
Author

coded9 commented Mar 24, 2017

pretty print code ? do you mean of the java System.out.print ? or with jsoup itself ?

@cketti
Copy link
Contributor

cketti commented Mar 24, 2017

@jhy
Copy link
Owner

jhy commented Jul 1, 2017

(If you add a <p> at the start the output is OK. So it's because the pretty printer is line breaking inline els when in a block el. That would be the fix. Would be nice to rebuild that all, it's a bit hairy.)

@jhy
Copy link
Owner

jhy commented Feb 2, 2020

Thanks, fixed with 279fbe1

@jhy jhy closed this as completed Feb 2, 2020
@jhy jhy added the bug Confirmed bug that we should fix label Feb 2, 2020
@jhy jhy added this to the 1.12.2 milestone Feb 2, 2020
jhy added a commit that referenced this issue Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug that we should fix
Projects
None yet
Development

No branches or pull requests

3 participants