Skip to content

Fix/preserve closing bracket 1707#2439

Open
SarthakDudhe wants to merge 4 commits into
beautifier:mainfrom
SarthakDudhe:fix/preserve-closing-bracket-1707
Open

Fix/preserve closing bracket 1707#2439
SarthakDudhe wants to merge 4 commits into
beautifier:mainfrom
SarthakDudhe:fix/preserve-closing-bracket-1707

Conversation

@SarthakDudhe
Copy link
Copy Markdown

Issue #1707: Preserve newline before closing bracket
Problem: When wrap_attributes was set to "preserve", the HTML beautifier would incorrectly move the closing angle bracket (>) to the same line as the last attribute, even if a newline existed in the input.

Changes Made:

Updated js/src/html/beautifier.js to respect preserved whitespace/newlines before the tag's closing token when using preservation options.
Added a regression test in test/data/html/tests.js to ensure the newline is maintained.
Verified that all HTML tests pass in the source and bundle.

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

Successfully merging this pull request may close these issues.

1 participant