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

Fix: not detecting tabs as a valid seperation between tags. #813

Merged

Conversation

ethan-vanderheijden
Copy link
Contributor

@ethan-vanderheijden ethan-vanderheijden commented Feb 3, 2024

Resolves: #812

  • Added tests for changed code.

It wasn't detecting tabs as a valid whitespace between HTML tags, causing it to transform:
<div>\n\t<p></p>\n</div>
into:
<div>\n\t\n<p></p>\n</div>

Notice that the transformed text has an extra new line after the tab character. Normally extra new lines are removed, but with --preserve-blank-lines, this extra new line persists.

Note:

  • --preserve-blank-lines and --max-blank-lines are incompatible with each other (I think this was true before my PR). Since --max-blank-lines preserves blank lines as well, it would make a lot of sense to combine the two options into one.

Copy link

netlify bot commented Feb 3, 2024

Deploy Preview for djlint canceled.

Name Link
🔨 Latest commit 3f84651
🔍 Latest deploy log https://app.netlify.com/sites/djlint/deploys/65fed174be3f1e0008d45a4a

@monosans monosans changed the base branch from master to dev July 12, 2024 13:20
@monosans
Copy link
Member

Thank you!

@monosans monosans merged commit ab9e467 into djlint:dev Jul 12, 2024
4 checks passed
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.

[BUG] [Formatter] --preserve-blank-lines does not work on files indented with tabs.
2 participants