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
In/dedentation is sometimes incorrect when multiple tags are on the same line #5
Comments
Hi there, and first of all thanks for trying this out. We've just started this project and we'd love to improve it further. Feedback such as yours is invaluable! As for now, DJHTML is only adding/removing spaces. It won't change anything else, so it won't change this:
to this
Because that would require splitting an existing line into two lines. However, I think the expected output for this snippet should be the following, which according to your bug report it's not:
I will look into this and publish an update shortly! |
@JaapJoris Yeah, that would be an improvement! I will definitely be keeping an eye on progress of this package. It's looking great! |
I have improved the indenting algorithm in the latest version. Your example now results in the following output:
Without adding extra newlines, I believe this is the "most" correct this template could get. Do you agree? |
Looks great! |
Awesome! If you have any other suggestions, feel free to open more issues! |
Really impressed with this package!
I noticed that in some of my longer templates in which I have sloppily at times had variations on
<div><div>
or</div><div>
or</div></div>
in the same line, things can get a bit weird. It's still valid html, but it's not pretty, and seems to trip djhtml up just a bit.For instance, this minimal example:
I would expect something like this where the final div and {% endblock %} are fully left-justified:
Or maybe this in a perfect world (though I suspect this would take a LOT more work to achieve via djhtml)
But the actual output is this:
I wish I were good enough with parsing/formatting to submit a PR, but hopefully this is at least helpful input.
The text was updated successfully, but these errors were encountered: