Extension:CodeMirror

The CodeMirror extension provides syntax highlighting in MediaWiki's wikitext editor. It adds the button with logo  to toolbar that allows switch on/off syntax highlighting. It supports both meta>meta:Help:Edit_toolbar|Classic edit toolbar and toolbar>Special:MyLanguage/Extension:WikiEditor|WikiEditor toolbar.

By default it is switched off. When switching on, it will replace the standard textarea with the editor provided by [http://codemirror.net CodeMirror library]. When switching off, it will be the opposite effect.

You can use your own styles for wikitext highlighting. Used styles available [https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCodeMirror/HEAD/resources%2Fmode%2Fmediawiki%2Fmediawiki.css here]. You should place your own styles to common>Special:MyLanguage/Manual:Interface/Stylesheets|common.css. If you have found better styles please let me known.

Browser support
The desktop versions of the following browsers are supported:


 * Firefox version 4 and up
 * Chrome any version
 * Safari version 5.2 and up
 * Internet Explorer version 8 and up
 * Opera version 9 and up

Modern mobile browsers tend to partly work.

Screenshots
[http://test.foxway.org/w/index.php5?title=Sandbox:CodeMirror&action=edit Live demo].

Configuration parameters
Add the above code at the bottom of your .

To Do

 * highlighting definition lists (foo : bar ) (**; foo :bar )
 * auto-completion
 * brace matching (13302)
 * code folding
 * highlighting inside gallery tag