Put a bit of HTML inside a
 tag?

后端 未结 3 2106
北海茫月
北海茫月 2021-01-12 10:39

How do I put a bit of HTML inside a tag without escaping it? Or am I using an incorrect tag?

P.S. I cannot escape the HTML, it is produced by the s

3条回答
  •  佛祖请我去吃肉
    2021-01-12 11:23

    You need to escape the HTML, like so:

    You can use HTML entities that are escaped and printed without compiling.

    < // will print <
    > // will print >
    

    Using these two, you can print any HTML elements.

    <div> // will print 

    To solve your specific problem, you will need to parse the HTML string and convert the chevrons to these entities.

提交回复
热议问题