Closed radiocity closed 5 years ago
Hi, I don't understand this syntax:
a(href = "#" rel = "nofollow")!=$pageTitle
Would be quite enough to display unescaped text inside a tag.
Or in interpolation style:
a(href = "#" rel = "nofollow") !{$pageTitle}
Block expansion is not supposed to be for texts (as text doesn't need it to be on the same line), expansion is between 2 tags.
Thanks.
IMHO, It doesn't matter if you do not understand syntax or its purpose. It should work as designed with no suprices.
In documentation we explain:
Block Expansion To save space, Phug provides an inline syntax for nested tags.
This means we guarantee the behavior for nested tags. Supporting more is a feature request.
Supporting extra verbosity in a language designed to shorten your template code and bring clarity via a lighter syntax is a nice-to-have.
If you may explain why my alternative does not suit, I will reconsider. Else, since any additional syntax support comes with a regression risk, development, maintenance, documentation efforts and performance cost, I can't implement every possible edge-case just because it can be used some day somewhere, I have to evaluate if benefits worth it.
Thanks for your understanding.
I'm still ready to re-open if there is something you can't achieve with !=
or !{}
Hello,
I encountered an issue with the following code:
I expected to get:
But I actually get:
Workaround:
Thanks!