`How to solve the problem with special replacement of characters in pug when running through a loop in PUG?
A
A
Alexey Dubrovin2021-06-28 09:09:56
Pug
Alexey Dubrovin, 2021-06-28 09:09:56

How to solve the problem with special replacement of characters in pug when running through a loop in PUG?

The data is like this:

var items = [
        {bg:'#5FD0DF',img:'/img/wifi.svg',text:`цифровые <br>сервисы`},
        {bg:'#ff7d4e',img:'/img/loop.svg',text:'<b>Исследуем</b><br>общественно-политические<br>процессы'},
        ]

Paste Mixin:
mixin item(item,val,text)
    .item(style=`background-color:${item.bg}`)
        p.count=val+1
        .img(src=`item.img`)
        p.info=text

cycle:
each item,val in items
            +item(item,val,item.text)

As a result, during processing, characters are eventually replaced with protected ones:
<p class="info">&lt;b&gt;Исследуем&lt;/b&gt;&lt;br&gt;общественно-политические&lt;br&gt;процессы</p>

Am I doing something wrong, because I do not fully understand how to work with this.
Or is it a limitation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-06-28
@alekcena

https://pugjs.org/language/interpolation.html#stri...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question