Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#188 parse_text inserting html into editor

open
nobody
None
5
2012-12-25
2011-04-14
Travis Long
No

In Tiki Wiki, when using the CKEditor WYSIWYG editor, GeSHi is parsing the code and inserting HTML code.
It renders fine when the page is saved, but when you edit code in the editor, the formatting is broken.

Example:
select * from person where clue = 'true';

Once this is saved and you enter the editor again, you get:
select * from person where clue = 'true';

This does not happen when you turn off CKEditor/WYSIWYG.

I found a work around on this website:
http://peterpetrik.com/blog/ckeditor-and-geshi-filter

The workaround states:
For the issue of GeSHi not converting special entities such as < and > open geshi.php from sites/all/modules/geshifilter/geshi and add the following code on line 2046. You can also search for "// Replace all newlines to a common form." in the existing code.

// Replace all newlines to a common form.
$code = str_replace(">", ">", $code);
$code = str_replace("&lt;", "<", $code);
$code = str_replace("&lsaquo;", "‹", $code);
$code = str_replace("&rsaquo;", "›", $code);
$code = str_replace("&#39;", "'", $code);
$code = str_replace("&quot;", "\"", $code);
$code = str_replace("&amp;", "&", $code);

However if you make this modification, Tikiwiki starts generating HTTP 500 internal server errors.

Discussion