Opened 5 years ago

Closed 5 years ago

#13189 closed Bug (invalid)

Prevent converting html entities to tag

Reported by: majafy Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

I use CKEditor in my project, I use html entities in my content like this:

Sample Code: <pre> &lt;div&gt; &lt;a href=&quot;#&quot;&gt;test&lt;/a&gt; &lt;/div&gt; </pre>

but in CKEditor these html entities will convert to tags so this code will show:

Sample Code: <pre>

</pre>

<div><a href="#">test</a></div>

Change History (1)

comment:1 Changed 5 years ago by Piotrek Koszuliński

Resolution: invalid
Status: newclosed
Version: 4.4.7

I guess that you load content using a textarea. You should encode it before setting it there, because this:

<textarea>&lt;a&gt;</textarea>

when accessed through textarea.value will return just this:

<a>
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy