The macro quote is escaped in the html source code, which is not what I want. Actually safe doesn't work here, it should be because it's in the wrong place, but I don't know where to put it.
<div style="max-width: 10rem"</div>
This is the result I want, is there a way to keep the inline structure of the shorthand to solve it?
<div style="max-width: 10rem"></div>
For the time being, I can only give up the inline structure and use set to add a variable to solve.
{% set style = 'style="max-wdith: ' + maxWidth + '"' if maxWidth %}
<div {{ style | safe }}></div>
{{ example(maxWidth = '10rem') }}
The macro quote is escaped in the html source code, which is not what I want. Actually
safe
doesn't work here, it should be because it's in the wrong place, but I don't know where to put it.<div style="max-width: 10rem"</div>
This is the result I want, is there a way to keep the inline structure of the shorthand to solve it?
<div style="max-width: 10rem"></div>
For the time being, I can only give up the inline structure and use set to add a variable to solve.
Thanks for help.