Answer the question
In order to leave comments, you need to log in
How to process JSON from the server so that tags in the JSON file fire when displayed on the site?
Hello everyone, tell me how to process JSON from the server so that tags in the JSON file work when displayed on the site. I accept a string, there is text and tags, everything is inserted in one heap.
Just like in this form I write here - this is a textarea, and when I click Publish, I see the text with processed tags and line breaks.
When developing, I use nodejs, express, pug, mongodb, mongoose, to process formidable forms.
Answer the question
In order to leave comments, you need to log in
-
var data = {
html: '<ul><li>1</li></ul>'
};
//- вставится с экранированием
div #{data.html}
//- вставится без экранирования
div !{data.html}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question