-
Notifications
You must be signed in to change notification settings - Fork 14
[feature request] multi-line django template tags #45
Comments
Hmm not sure about this. It worked in the past because even tho To make this work again we'd have to go back to ignoring malformed elements or add some kind of exception for lines beginning Ideally we'd find a more Haml way to do what you want - something that adheres to Haml's use of indentation to determine structure. Users shouldn't be resorting to I think in actual Haml you'd use If you need an immediate workaround I think your example would work as... {% my_tag
so=True
many='VeryLongStringIdWhatever'
params=somevar %} |
Another way to do this is to use
|
Been brainstorming with @nicpottier about this. It's challenging to support consistent mixing of Django and Haml outside of Haml's hierarchical node structure, but would be relatively straightforward to support Django tags as a special node type. So.. {%
trans "hello"
%}
%span
{%
trans "hello"
%} becomes {%
trans "hello"
%}
<span>
{%
trans "world"
%}
</span> The requirement here is that the |
to be clear, this would work as well ya?
|
We tried to use %} and same-line "%}"-closing tag, both workarounds didn't work, but I hadn't much time to play around as I was supposed to do a code review, I might try it later tonight or tomorrow. The newline requirement to handle the native tags would be perfectly fine for us :) |
So having slept on this I've come back to letting the node parser just ignore lines beginning Ideally tho users shouldn't have to revert to native tags and the fact that they do (even we do) points to deficiencies in the |
@AndreCimander #46 is merged now and should fix your issue |
First of all: Thank you for picking up maintenance of the package! 👍
We just noticed in #583c0a3 with that we can't use multi-line django template tags anymore... which was neat to increase readability. e.g.
Any chance in getting this feature back?
The text was updated successfully, but these errors were encountered: