Code Filter does not work with FCKeditor

zoon_unit - January 5, 2009 - 19:23
Project:Code Filter
Version:6.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

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?????

#1

sersim - February 10, 2009 - 11:25
Status:active» needs review

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)

AttachmentSize
codefilter_for_fckeditor.zip 1.82 KB

#2

shehateme - August 28, 2009 - 02:24

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

 
 

Drupal is a registered trademark of Dries Buytaert.