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://phabricator.wikimedia.org/diffusion/ECMI/browse/master/resources/mode/mediawiki/mediawiki.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
All browsers 1>Special:MyLanguage/Compatibility#Browser support matrix|supported by MediaWiki are supported.

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 (T15302)
 * code folding
 * highlighting inside gallery tag