In condition to issue #1293476: How to combine GeSHi Filter with Wysiwig module (TinyMCE editor) ?.
We can manually tune GeSHi Filter for use with wysiwyg editors:
1. Only one tag is allowed for filter - <pre>
2. Turn off any html validation in wysiwyg editors setting.
3. Insert your code in editor textarea as <pre> tag in form <pre start="1" linenumbers="normal" type="my language" title="My title"> or use http://drupal.org/sandbox/victor_gamedev.by/1270766 module.
4. Edit geshifilter.pages.inc file. In function geshifilter_geshi_process() add after

  // remove leading/trailing newlines
  $source_code = trim($source_code, "\n\r"); 

this lines

  // fix: Replace any HTML specials
  $source_code = str_replace("&gt;", ">", $source_code);
  $source_code = str_replace("&lt;", "<", $source_code);
  $source_code = str_replace("&lsaquo;", "‹", $source_code);
  $source_code = str_replace("&rsaquo;", "›", $source_code);
  $source_code = str_replace("&#39;", "'", $source_code);
  $source_code = str_replace("&quot;", "\"", $source_code);
  $source_code = str_replace("&amp;", "&", $source_code); 

that's all.

CommentFileSizeAuthor
#1 light_wysiwyg_integration_1294694_1.patch864 byteslliss

Comments

W32’s picture

Issue summary: View changes

correct bug in text

lliss’s picture

StatusFileSize
new864 bytes

This patch provides a fix for problems caused by conflicting format correction when using geshi filter module and a wysiwyg style editor such as TinyMCE or CKEditor.

So I don't particularly like this fix long term but if you (like me) need geshi filter to work with WYSIWYG style editors and you don't particularly care if it works without them, then this patch is probably fine. I haven't tested it without the editor but it solves the problem when using TinyMCE which is currently good enough for my purposes and may be for others as well.

lliss’s picture

Issue summary: View changes

again correction

yukare’s picture

Issue summary: View changes
Status: Active » Fixed

Because of #2047021: Special chars are html entities in highlighted code this is not necessary anymore.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.