I read a lot about problems where ckeditor removes geshi tags.
The solution to stop that is adding this to the config.js in the root folder of ckeditor
// do not touch code inside of <foo></foo> and [foo] [/foo]
config.protectedSource.push( %\[.*\].*\[/.*\]%i );
config.protectedSource.push( %\<.*\>.*\</.*\>%i );
That works and the correct geshi highlighting is applied.
Somehow there is another problem left. If you switch from source view to normal view. It will kill all formatting of tha code. Example code
/**
* @file
* Integrates client-side editors with Drupal.
*/
/**
* Implements hook_entity_info().
*/
function wysiwyg_entity_info() {
$types['wysiwyg_profile'] = array(
'label' => t('Wysiwyg profile'),
'base table' => 'wysiwyg',
'controller class' => 'WysiwygProfileController',
'fieldable' => FALSE,
// When loading all entities, DrupalDefaultEntityController::load() ignores
// its static cache. Therefore, wysiwyg_profile_load_all() implements a
// custom static cache.
'static cache' => FALSE,
'entity keys' => array(
'id' => 'format',
),
);
return $types;
}
will become:
/** * Implements hook_entity_info(). */ function wysiwyg_entity_info() { $types['wysiwyg_profile'] = array( 'label' => t('Wysiwyg profile'), 'base table' => 'wysiwyg', 'controller class' => 'WysiwygProfileController', 'fieldable' => FALSE, // When loading all entities, DrupalDefaultEntityController::load() ignores // its static cache. Therefore, wysiwyg_profile_load_all() implements a // custom static cache. 'static cache' => FALSE, 'entity keys' => array( 'id' => 'format', ), ); return $types; }
so it seems the protected source config tag works not for the formatting options so i think it is neccessary to use: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting
as of another post it seems that the ckeditor-3.0.js needs to be hacked to prevent the reformatting between the geshi tags (only guessing)
opinions? i will post the solution if i find one.
Comments
Comment #1
marcoka commentedfollowing is on
[x] Apply source formatting (if not it complete removes every \r \t and all formatting is completely gone)
[x] Verify HTML
[x] Convert tags to styles
[x] Force cleanup on standard paste
rest is off
Comment #2
twodHave you tried Wysiwyg GeSHi bridge?
I know it only has a D6 release but you should only need to change the version info in the .info file to make it work for D7 since it's just an implementation of our plugin hook.
Comment #3
marcoka commentednot yet. i will check that out and post if i succeed. thx
Comment #4
marcoka commentedgeshi bridge will not solve this. if i understand it correctly it only enables buttons in the toolbar.
(i can not belive that the protected source tag actually does NOT protect the formatting).
maybe someone will answer for my topic in the ckeditor forum:
http://cksource.com/forums/viewtopic.php?f=11&t=22744
Comment #5
twodThe buttons provided by the GeSHi plugin for CKEditor applies a "style" to the current selection (or around just the caret), wrapping it in
<pre language="php"></pre>tags.The pre tags should keep the source from being mangled in the editor, and the GeSHi filter module should be able to find those pre tags and apply the proper highlighting during rendering.
The changes descriped on the plugin's project page may be needed if the editor turns
<into<etc.Note that by default Wysiwyg module does not load CKEditor's config.js file since we like to avoid having to modify a library's files.
Comment #6
marcoka commentedoh. so my:
is not beeing used because i added it to the stdandard config.js?
Comment #7
twodExactly. You'll need to set the customConfig setting to make it load if you need it. Just remember that the settings sent directly to the editor instance when it is created will override any corresponding setting from the config file (which is why Wysiwyg doesn't need it).
Comment #8
marcoka commentedah ok so use the wysiwyg hook to make "own" ckeditor settings/config. thx i will try that
Comment #9
marcoka commentedall this protected stuff is all not working and you will waste a lot of time searching and finding a lot of discussions. non of them worked for me. even in the ckeditor forum, no reply.
BUT i found a way:
just use pre tags not [php] or [[php]]. the geshi authors are great giving such felxibility.
the following works and ckeditor will not fuck up the source code. yey!
everything inside the pre tags will now be highlighted and the formatting will be preseverd if you edit with ckeditor.
Comment #10
sunNot sure what the actual resolution in #9 is, but removing the bloat of invalid issue tags.
Comment #11
drupalfan81 commentedWhat the guy in #9 is saying is that if you use the