如何从tinymce编辑器中删除特殊字符

How to remove special characters from tinymce editor

我在网页中使用 tinymce 编辑器。当我尝试 post 一些评论时,它 post 的格式如下:

<p>&lt;p&gt;Hi&lt;/p&gt;<br />&lt;p&gt;Lauren how are you?&lt;/p&gt;</p>

而不是:

<p>Hi</p>
<p>Lauren how are you?</p>

我试图解决这个问题,但没有任何帮助。

哦,太简单了,好的,我明白了,

我们开始了html_entity_decode

总之非常感谢 :)

您也可以使用 html_entity_decode()

echo  html_entity_decode('&lt;p&gt;Hi&lt;/p&gt;<br />&lt;p&gt;Lauren how are you?&lt;/p&gt;');

尝试使用 decodeURIComponent 方法。

str = "<p>&lt;p&gt;Hi&lt;/p&gt;<br />&lt;p&gt;Lauren how are you?&lt;/p&gt;</p>";

document.write(decodeURIComponent(str.replace(/\+/g, ' ')));