D
D
DTX2016-09-15 22:29:29
HTML
DTX, 2016-09-15 22:29:29

JADE. How to pass br to mixin?

How to make it work?

mixin whyus_item(h2)
  .item
    h2=h2
+whyus_item('Line1\nLine2')
+whyus_item('Line1 <br /> Line2')

codepen.io/anon/pen/xEVNaJ

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-09-16
@DirecTwiX

It is necessary to disable protection from entering html tags:

mixin whyus_item(h2)
  .item
    h2!=h2
+whyus_item('Line1\nLine2')
+whyus_item('Line1 <br /> Line2')

On the third line.
Although if this case is generated on a server in online access, you need to do this with care so as not to get a hole. If local processing - then everything is OK.
Here you can read the manual: jsman.ru/jade/#section-15
About unescaped output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question