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

Postprocessor example using JSoup break formatting #13

Open
ysb33r opened this issue Apr 13, 2017 · 3 comments
Open

Postprocessor example using JSoup break formatting #13

ysb33r opened this issue Apr 13, 2017 · 3 comments

Comments

@ysb33r
Copy link
Member

ysb33r commented Apr 13, 2017

The currency example utiilisingJSoup can lead to some unexpected formatting issues especially with source blocks.

https://github.com/ysb33r/SampleProjects/tree/AsciidocGradleExtention is a reproducible sample. If the extension is removed the embedded Javadoc example renders correctly. If the extension is used the Javadoc renders as a single line.

@ysb33r
Copy link
Member Author

ysb33r commented Apr 13, 2017

It seems to be a case that JSoup does not maintain whitespace and linebreaks during parsing.

@robertpanzer
Copy link
Member

I'm currently on vacation. I'll have a look into this issue once I am back.
That sounds really strange.

@robertpanzer
Copy link
Member

Just reproduced it with a pure JSoup test.
It seems that it's somehow related to the combination of <pre><code><span>.
This code removes the newlines:

    System.out.println(Jsoup.parse("<html><body><pre><code><span>  A\n B \n C</span></code></pre></body></html>"));

This doesn't:

    System.out.println(Jsoup.parse("<html><body><pre><code>  A\n B \n C</code></pre></body></html>"));

Also this doesn't remove the newlines:

    System.out.println(Jsoup.parse("<html><body><pre><span>  A\n B \n C</span></pre></body></html>"));

Unless this is an intended behavior in Jsoup I would suspect it to be an error in Jsoup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants