I cannot get the code filter to work properly with FCKeditor. All code related symbols are saved in the node as literals instead of the proper symbols nested within a "code" bracket.

Any advice on getting these two modules to work together?????

CommentFileSizeAuthor
#1 codefilter_for_fckeditor.zip1.82 KBsersim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sersim’s picture

Status: Active » Needs review
FileSize
1.82 KB

Code Filter doesn't expect to receive characters converted to HTML entities.
Besides FCKeditor strips newlines between <code> and </code> .
Since FCKeditor doesn't strip newlines between <pre> and </pre>, I've edited Code Filter in order to detect code between <pre name="code" class="language"> and </pre> and decode HTML entities.

Download the Code Syntax Highlight Plugin for FCKeditor
http://psykoptic.com/blog/post/2008/12/01/Code-Syntax-Highlight-Plugin-f...

Edit the file syntaxhighlight/dialog/fck_syntaxhighlight.html as described in the comment I've posted on that page (2/9/2009 4:58:49).
Upload this plugin into sites/all/modules/fckeditor/plugins

This plugin adds a "code" button in FCKeditor, let you past your code into a popup window, and automatically embed it in "pre" tags. It was developed to be used with a javascript syntaxhighlighter ( http://code.google.com/p/syntaxhighlighter/w/list ) but it works with this patched version of Code Filter too.

codefilter.module changes:
- added decode_entities in line 33
- added decode_entities in line 75
- detect the code inside <pre name="code" class="language"> and </pre> lines 125-129 (FCKeditor changes the attributes order when you switch from normal view to source view)

shehateme’s picture

Hi, I just wonder what version of code-syntax-highlight plug in do you use, I tried it in V2.0 but it wont work for me

drecute’s picture

Hi, I am experiencing the same problem of literal tag returned after saving a node. I have added the tag as part of the list for allowed HTML tags, but still no headway. Also I don't seem to see any representation of the code filter at admin/settings/fckeditor under security fieldgroup.

I have been on this now for 5 days. I urgently need help on this.

Thanks.

schedal’s picture

For those stuck, please also look into this module: http://drupal.org/project/geshifilter

selinav’s picture

#1, I have followed the link http://psykoptic.com/blog/post/2008/12/01/Code-Syntax-Highlight-Plugin-f... but I don't succeed to work fckeditor with codefilter.

Can you give me more information about the files to update. I have the message unknown syntaxhighlighter2 tool element.

What file should I modify sites/all/modules/fckeditor/fckeditor/fckconfig.js or sites/all/modules/fckeditor/fckeditor.config.js ?
In what directory should I copy the plugin ? sites/all/modules/fckeditor/fckeditor/editor/plugins/syntaxhighlighter2 ?

Thanks in advance

fgm’s picture

Version: 6.x-1.0 » 8.x-1.x-dev
Priority: Critical » Major
Issue summary: View changes

FWIW, this is still true with D8 CKEditor.