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

📝 Formatting HTML removes comment #4043

Closed
1 task done
dyc3 opened this issue Sep 22, 2024 · 1 comment · Fixed by #4056
Closed
1 task done

📝 Formatting HTML removes comment #4043

dyc3 opened this issue Sep 22, 2024 · 1 comment · Fixed by #4056
Labels
A-Formatter Area: formatter L-HTML Language: HTML S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@dyc3
Copy link
Contributor

dyc3 commented Sep 22, 2024

Environment information

playground

Configuration

No response

Playground link

https://biomejs.dev/playground/?files.main.html=dABlAHgAdAAKAAoAPAAhAC0ALQAgAGYAbwBvACAALQAtAD4ACgAKAA%3D%3D

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@dyc3 dyc3 added A-Formatter Area: formatter S-Bug-confirmed Status: report has been confirmed as a valid bug L-HTML Language: HTML labels Sep 22, 2024
@dyc3
Copy link
Contributor Author

dyc3 commented Sep 22, 2024

I think I understand what is happening here. Instead of the trivia at the end of the file being treated as trailing trivia, it because leading trivia on the next node. In this case its, the next node is eof, but it could also be another element. It seems like the newlines ultimately cause this behavior.

What I don't understand is why eof isn't printing it's trivia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-HTML Language: HTML S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant