markup_fmt seems to force wrapping when there are more than 2 non-text element in an html element.
This introduces some unusual wrapping when there are 2+ jinja interpolation inside an element (which is actually quite common).
This MR changes the behavior slightly to check for text-like nodes (reusing existing logic to identify them).
You should probably review this commit per commit because I also did some small refactoring along the way when I was trying to figure out the leading/trailing ws handling. I made sure every commit was always passing the test suite. Only the last commit introduces the behavior change described above.
I'll be happy to make any changes if my implementation doesn't satisfy your needs.
Cheers
Hi!
markup_fmt
seems to force wrapping when there are more than 2 non-text element in an html element. This introduces some unusual wrapping when there are 2+ jinja interpolation inside an element (which is actually quite common).This MR changes the behavior slightly to check for text-like nodes (reusing existing logic to identify them).
You should probably review this commit per commit because I also did some small refactoring along the way when I was trying to figure out the leading/trailing ws handling. I made sure every commit was always passing the test suite. Only the last commit introduces the behavior change described above.
I'll be happy to make any changes if my implementation doesn't satisfy your needs. Cheers