CKEDITOR is deleting almost everything I have inside a <code>-Tag on load. And also inside whatever it is.
Without the editor it comes out as it is supposed to. Prevention?
That's what was saved before with the editor to database:
Beispiel:<br />
<br />
<code>...<br />
<head><br />
...<br />
<script src="http://www.deutschland-regional-chat.de/api/regiochat.js"></script><br />
...<br />
</head><br />
<body><br />
<script type="text/javascript"><br />
$(document).ready(function(){<br />
$regiochat->api_start('APICODE');<br />
}<br />
</script><br />
</body><br />
...</code>
When the editor now is loaded with the text from the database it's all changed like this:
Beispiel:
<blockquote>
<p>...</p>
</blockquote>
<br />
<br />
...<br />
<br />
...<br />
<br />
<br />
<br />
<br />
Another example in the same editor-block:
Input:
<td style="text-align:center; width:150px;">
<form action="http://www.deutschland-regional-chat.de/api/api_registrierung" method="POST">
<button type="submit">Jetzt zur Nutzung der API registrieren</button></form>
</td>
What comes out:
<td style="text-align:center; width:150px;">
Jetzt zur Nutzung der API registrieren</button>
</td>
Nearly all Text is gone, a blockquote-element is there that does not belongs there and a <p>-tag also is there. When the editor is loaded and before the user starts to edit, it is just not supposed to change anything. How can I reach that? If the editor behaves like shown, I cannot use it any longer. I mean, when I edit text here in the forum it behaves normal. Why not on my web site?
Read the CKEditor 4.1 Release
Read the CKEditor 4.1 Release Note http://ckeditor.com/blog/CKEditor-4.1-Released
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
That helped not with every problem.
The problem that remains is now: in textarea we have for example < but when the editor loads it magically translates < to <
Config:
config.enterMode = CKEDITOR.ENTER_BR;
config.uiColor = '#D09F8A';
config.fullPage = false;
config.ignoreEmptyParagraph = true;
config.autoUpdateElement = true;
config.startupMode = 'source';
config.basicEntities = true;
config.htmlEncodeOutput = false;
config.allowedContent = true;
-----------------------
SOLVED (PHP: What goes to <textarea> now preformattet):
$string = str_replace('<', '&lt;', $string);
$string = str_replace('>', '&gt;', $string);
$string = str_replace(''', '&#39;', $string);
ckeditor is then interpreting input as wanted.