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

Unstable whitespace normalization around comments #1906

Closed
GeorgEchterling opened this issue Feb 24, 2023 · 2 comments
Closed

Unstable whitespace normalization around comments #1906

GeorgEchterling opened this issue Feb 24, 2023 · 2 comments
Assignees
Labels
bug Confirmed bug that we should fix fixed
Milestone

Comments

@GeorgEchterling
Copy link

GeorgEchterling commented Feb 24, 2023

I encountered an issue where normalizing (Jsoup.parse(doc).toString()) an already-normalized document produces a different output.

Normalizing this document:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Test</title>
 </head>
 <body>
  <!-- Comment -->
 </body>
</html>

Produces this output:

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Test</title>
 </head>
 <body><!-- Comment -->
 </body>
</html>

I.e. the whitespace between the opening body tag and the comment gets removed.

However, normalizing that output then produces the original document with the space between the opening body tag and the comment.

At first I thought this was related to the pretty-printing improvements in version 1.15.4, but it also appears in version 1.15.3.

@jhy jhy self-assigned this Mar 9, 2023
@jhy jhy added this to the 1.16.1 milestone Mar 9, 2023
@jhy jhy added the bug Confirmed bug that we should fix label Mar 9, 2023
@jhy jhy closed this as completed in a90bae7 Mar 9, 2023
@jhy jhy added the fixed label Mar 9, 2023
@jhy
Copy link
Owner

jhy commented Mar 9, 2023

Thanks, fixed!

@GeorgEchterling
Copy link
Author

Thank you! :)

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 fixed
Projects
None yet
Development

No branches or pull requests

2 participants