You are here:Home»KB»Web Design»CMS»Joomla»Extensions»Prevent Code stripping in CKeditor for Joomla
Saturday, 05 May 2012 00:00

Prevent Code stripping in CKeditor for Joomla

Written by

ckeditor straight from the original designers, which now have done this joomla plugin still messes with your html and code preventing geshi.

There is an easy solution to protect any code within specified tags.


  • In the components menu
  • goto the advanced tab
  • paste the following code in to the Custom Javascript configuration
    CKEDITOR.config.protectedSource.push( /{code[\s\S]*?}[\s\S]*?{\/code}/g );
    CKEDITOR.config.protectedSource.push( /{geshibot[\s\S]*?}[\s\S]*?{\/geshibot}/g );
  • As you can see there is 2 lines, one is to protect everything within {co de}{/co de}and {geshi bot}{/geshi bot} tags (without the spaces). you can also make you own.
  • I have left Html entities enabled as they do not affect code inside protected storage

 

Read 1189 times Last modified on Wednesday, 26 November 2014 20:00