djLint icon indicating copy to clipboard operation
djLint copied to clipboard

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

Open ethan-vanderheijden opened this issue 1 year ago • 1 comments

Resolves: #812

  • [x] 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.

ethan-vanderheijden avatar Feb 03 '24 22:02 ethan-vanderheijden

Deploy Preview for djlint canceled.

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

netlify[bot] avatar Feb 03 '24 22:02 netlify[bot]

Thank you!

monosans avatar Jul 12 '24 13:07 monosans