0
votes

I'm using TinyMCE's codesample plugin. It works the first time and saves correctly into the database, but when opening the editor again, it either strips the code sample content (if it's "illegal") or places it outside of the codesample tags.

Saved Code:

<pre class="language-markup"><code>&lt;!DOCTYPE html&gt;</code></pre>

When loading the editor again:

<pre class="language-markup"><code></code></pre>

Should the content somehow be filtered before returning it to the editor? I assume it's because the editor is converting the escaped HTML back to normal tags first...seems a bit silly really.

Anyone know a workaround for this or encountered this before?

Thanks in advance

1
How are you reloading the content into the textarea? Can you create a simple TinyMCE Fiddle or JS Fiddle that shows the exact actions you are taking? - Michael Fromin
Thanks for the response. I had a look at how I'm getting the value again and added a PHP htlmentities($content). Seemed to have done the trick. - Funktion

1 Answers

0
votes

See this TinyMCE Fiddle:

http://fiddle.tinymce.com/ITfaab

It seems to load your example code back into the editor just fine. What are you doing differently?