hi,

is it possible to tell the ckeditor not to strip php tags and not to modify custom tags like [code], using with geshi. at the moment he wraps [code] into

.
i enter these [code] tags in source code mode!

any ideas/tips?

Comments

jcisio’s picture

You may need some kind of plugin. To cite some:
http://cksource.com/forums/viewtopic.php?f=11&t=18963

marcoka’s picture

i dont want to integrate it in ckeditor. i want the ckeditor to STOP stripping out my [code], [php] ...tags, he destorys ,too

jcisio’s picture

AFAIK, CKEditor does not allow you to do that. You need a plugin or stop using a WYSIWYG editor.

mephir’s picture

@jcisio: it isn't true at all. Into settings there is property protectedSource, where you can add regular expression which stop ckeditor to process this code, it will be stay untouched. In documentation is sample reg exp which php support.

jcisio’s picture

Oh great! I wish I knew that sooner. Thanks.

jcisio’s picture

Status: Active » Closed (duplicate)
jcisio’s picture

Status: Closed (duplicate) » Active

Sorry, after playing a little I understand that two issues are different. protectedSource "protects" your code and but keeps it invisible. I don't know how to use it in this case.

jcisio’s picture

Status: Active » Closed (duplicate)

My bad! The protectedSource solves this problem.

jlockhart’s picture

Status: Closed (duplicate) » Active

Jcisio could you explain how you got this to work. Since I want my admins to be able to use PHP in the editor without ckeditor messing it up I put the following code

config.protectedSource.push( /<\?[\s\S]*?\?>/g );

into the Custom Javascript configuration box in the Advanced options for that user. Is that the correct place? It doesn't seem to be solving the issue. When I enter php into the source of the editor and then switch out of source, the code gets cut up again. A step by step on getting this working would be awesome.

Thanks

Michsk’s picture

This code does allready seem to be present in the ckeditor.config.js file but it does not protect the php code. I'm also struggling with this issue.

jdench’s picture

I have also been struggling with this. As I understand it, the code mentioned above protects most PHP code, but not code that you put inside href. The only way around the problem I have so far found is to put the PHP code around, rather than inside, the href, as described by ecki at http://dev.ckeditor.com/ticket/4475#comment:7.

It would be great if there were a simpler solution.

marcoka’s picture

i gave it up and use bu-editor now.

dczepierga’s picture

Status: Active » Closed (fixed)

It was fixed in CKEditor library on version 3.5.3:
http://dev.ckeditor.com/ticket/4475#comment:18

Greetings

marcoka’s picture

see here for a solution i am working on
http://drupal.org/node/1187948