CodeIgniter Forums
HTML Code displayed in text editor - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: HTML Code displayed in text editor (/showthread.php?tid=63539)



HTML Code displayed in text editor - cakka - 11-11-2015

Hello,

I am using TinyMCE as text editor for admin panel in my codeigniter website.
But, it is show the html code in edit mode like this :

Code:
<p>Suspendisse ac enim nisl. Suspendisse varius lorem sit amet neque aliquam, ut blandit justo finibus. Nam tempor sagittis dolor, non condimentum elit euismod sed. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer mollis varius volutpat.</p>

It should be not displaying the html code.

What I have to do to fix this problem ?

Thank you.


RE: HTML Code displayed in text editor - PaulD - 11-11-2015

I think, and I personally have not used tinyMCE for some time, that the HTML has been converted to html entities on input, so that the output is no longer seen as html code, but text.

You will see if that is the case by using their 'View code' button and you will see the <p> tag for example encoded as &lt;p&gt;

So somewhere in your code the input has been converted, then outputed without deconverion back to the editor, and the editor is behaving in exactly the right way.

The answer is to decode the entities with html-entity-decode before output.

http://php.net/manual/en/function.html-entity-decode.php

Hope that helps,

Paul.


RE: HTML Code displayed in text editor - cakka - 11-11-2015

[SOLVED]

I have to use : html_entity_decode(set_value(.....))

Thank you