My Wysiwig module (TinyMCE editor 3.4.5) works on Full HTML text profile, but output from GeSHi Filter (last dev version) all time is corrupted! How to combine them?

Comments

W32’s picture

Thank you for help.
http://drupal.org/sandbox/victor_gamedev.by/1270766 is very good solution for Wysiwyg module (TinyMCE editor) and GeSHi Filter.

wolf_22’s picture

Did that work for you? If it did, let's try to come up with some succinct documentation (i.e. - clearly-written steps) on here so that others can follow your footsteps when seeking a solution.

Also, please make sure to include actual version numbers...

laceysanderson’s picture

I got TinyMCE WYSIWYG to work with GESHI filter using the following steps:
1. Download and install WYSIWYG module (7.x-2.1)
2. Download TinyMCE (3.5) into sites/all/libraries
3. Download and install WYSIWYG Filter module (7.x-1.6-rc2)
4.Created a new Text Format with the name "WYSIWYG Filter"

  • Enabled the following under Enabled Filters and put them in the filter processing order listed below
    • WYSIWYG Filter
    • Encode email addresses: Javascript-wrapped HTML entities
    • Encode email addresses: HTML entities
    • Convert URLs into links
    • Correct faulty and chopped off HTML
    • GeSHi filter
    • Convert line breaks into HTML
  • for Filter Settings: WYSIWYG Filter I added the tags GESHI needed to the HTML elements and attributes (ie: add php,c,cpp,etc) and pre

5. In WYSIWYG Profiles I set the editor for my "WYSIWYG Filter" text format as TinyMCE<

  • for "Cleanup and Output" I disabled everything except Apply Source formatting

6. Left defaults for GESHI configuration (no line numbers)

Now to use the syntax highlighting in a textarea with WYSIWYG:

  1. Disable rich text-format
  2. Enter in <pre><php>your code here</php></pre> wherever you need it
  3. Re-enable rich text format and continue using WYSIWYG

The pre tag keeps everything from ending on up on one line. I found removing all HTML correction from the TinyMCE WYSIWYG profile was necessary to keep it from removing my php tag and replacing it with p tag. Als the covert line breaks needed to be below GESHI in the filter processing order or I ended up with br tags throughout my php code.

Hope this helps someone since it took me awhile to get working!
~Lacey

wolf_22’s picture

Lacey, that's one of the best examples of how documentation *should* be across the board.
Thank you for making a difference. :.)

prexa’s picture

Yes, this is the best example. Thanks a lot!

I also had trouble to make it working.

potassiumchloride’s picture

Issue summary: View changes

Lacey, your documentation is much appreciated.

In my use case, I removed the 'Convert URLs into links' filter entirely from the filters list. Having it above GeSHi was causing problems. Some users may want to move this filter beneath the GeSHi filter.