本人使用CKEditor7.x-1.18、GeSHi Filter7.x-1.2,在配置完CKEditor profile和文本格式之后,使用源代码添加代码高亮正常,但是在所见即所得模式下添加代码高亮格式被破坏,如<会被转义为< >会被转义为>
最终发现是GeSHi模块的问题,解决方案如下:
geshifilter.pages.inc.patch文件
--- geshifilter.pages_orig.inc 2008-05-01 22:26:14.000000000 +0200 +++ geshifilter.pages.inc 2009-01-13 16:54:44.000000000 +0100 @@ -220,7 +220,7 @@ function _geshifilter_replace_callback($ $complete_match = $match[0]; $tag_name = $match[1]; $tag_attributes = $match[2]; - $source_code = $match[3]; + $source_code = strip_tags(decode_entities($match[3])); // Undo linebreak and escaping from preparation phase. $source_code = decode_entities($source_code);
之后,重写添加代码段,发现已不再自动转义。
解决Drupal的Geshi将转义为>的问题