What I've tried:
mixin simpleDivInject(text)
div
h1 #{text}
mixin simpleDivInject("line one <br/> line two")
Desired outcome
<div>
<h1>line one <br/> line two</h1>
</div>
The actual outcome
<div>
<h1>line one <br/> line two</h1>
</div>
How can I achieve the desired outcome. I have tried a few more things (such as storing the string in a var ect.), but no luck so far.
Actually I just figured it out. Answering here in the hopes it is helpful to someone else down the line. The escaping is not occurring in the mixin argument system, but in the vinilla jade system, so:
mixin simpleDivInject(text)
div
h1!= text
mixin simpleDivInject("line one <br/> line two")
Solves the problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With