简体   繁体   中英

How to remove special characters from tinymce editor

I am using the tinymce editor in my web page. When I try to post some comment, it posts in the following format:

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

instead of:

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

I have tried to sort this out but nothing helped.

您也可以使用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;');

Oh it was so easy, ok i got it,

here we go html_entity_decode

anyways thanks so much SO :)

Try with decodeURIComponent Method.

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, ' ')));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM