7
votes

I'm using CKEditor (currently using ver. 3.4.1 - I can upgrade if it's necessary) and I'm missing a possibility to use the <code> tag, either from the Format dropdown or via a button on the toolbar.

I couldn't find a plugin that would make this possible. I have also no experience or knowledge of how to write my own plugin for that.

Do you know of a plugin that might help me enable the "code" button/format (wrapping selected text into <code> tags)? If there is none, I would appreciate if you directed me to online resources about CKEditor plugin development (some sort of tutorial explaining the bare basics).

In case it's useful, my site's using Drupal 6.19, CKEditor module, CKEditor 3.4.1. As for plugin development tutorials, I have already found this, but most of it seems to beyond my grasp.

3
What would that "code" button have to do exactly? The same as it does here on SO - indent a code block, and display it in a monospaced font? - Pekka
I'd rather it wrapped a selected piece of text in <code> tags :) - mingos

3 Answers

1
votes

I solved with this ckeditor plugin: http://code.google.com/p/ckeditor-syntaxhighlight/

It's also compatible with the jquery plugin SyntaxHighlighter http://alexgorbatchev.com/SyntaxHighlighter/

0
votes

Try https://ckeditor.com/cke4/addon/codeTag

config.extraPlugins = 'codeTag';

No additional dependencies.

-3
votes

Get wysiwyg Browse configuration>wysiwyg

... Enable the 'source' button.