Hello,
I'm using CKeditor in a PHP/mysql surrounding to store PHP, mysql,javascript etc snippets...
but when adding the following code to the wysiwyg interface of ckeditor it changes the source.
Original paste:
<?php print "<html><head></head><body>"; print "Help me"; print "</body></html>"; ?>
When clicking the source button of ckeditor it's source is changed to:
<p> <?php</p> <p> print "<html><head></head><body>";</p> <p> print "Help me";</p> <p> print "</body></html>";</p> <p> ?></p>
No problem, when i retrieve this text from the database and print it to html it look exactly as the original snippet text.
However when I want to re-edit this snippet to add something and request the snippet from the database and put it into the ckeditor the code is corrupt and looks like this:
<p> print "";<br /> print "Help me";<br /> print "";<br /> ?></p>
The wysiwyg interface displays:
print ""; print "Help me"; print ""; ?>
This is, ofcourse, totally unuseable...
if have tried this: (and searched the web extensively for other sollutions!)
config.protectedSource.push( /<\?[\s\S]*?\?>/g );
But This only displayes the code in de source of the editor, and now I cannot use the text editor, and thats what it's there for isn't it?
I'm using CKEditor 3.0.1 (revision 4391)
Does anybody know how to remedy this?
Re: Use ckeditor as snippet editor
When I have entered the snippet saved it to the database and redisplay it while turning of the ckeditor and view the text area, it displays correctly just like the div.
the source for the textarea is:
When I turn on the ckEditor again and refresh the page, the code in the text area is still the same but it is displayed wrong inside the ckeditor and the source of ckeditor is also wrong. (see my previous post) I therefore conclude that without an appropriate setting, redisplaying code, ckeditors display of text between is totally wrong.
I can't emagine that there is no way to redisplay code correctly within ckeditor. There mus be some setting because I think the authors of CKeditor are smart enough to add some solution for it.
Who picks up the gauntlet??
Re: Use ckeditor as snippet editor
Re: Use ckeditor as snippet editor
You are so wright.
Upgrading was not neccesary though.
I added htmlentities to my textarea and ckeditor wysiwyg interface displays the stuff correctly now.
Many thanx for your reply..
Re: Use ckeditor as snippet editor