D
D
Dmitry Lokshin2017-04-05 14:03:04
JavaScript
Dmitry Lokshin, 2017-04-05 14:03:04

How to insert tags in json?

Hello dear developers.
In my layout template I use jade in which I display content from json.
Those. I create a regular .json file into which I drive content, like this:

{
   "reviews" : {
      "review1" : {
         "name" : "Vasya",
         "age" : 25
      }
   }
}

and then through the loop I output to jade. In general, this is not the point. The problem is that if I insert tags into json, but it simply converts them to text, for example:
{
   "reviews" : {
      "review1" : {
         "name" : "Меня зовут <span>Вася</span>",
         "age" : 25
      }
   }
}

output like this:
My name is <span>Вася</span>, i.e. tags are not applied, but are displayed as text.
Help, please, to solve this problem, because. I don't know what to try anymore.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alex, 2017-04-05
@Ddmitrich

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question