Topic on Extension talk:CodeMirror

Disabling CodeMirror by a user

4
Maksim E. Otstavnov (talkcontribs)
 wfLoadExtension( 'CodeMirror' );
 # Enables use of CodeMirror by default but still allow users to disable it
 $wgDefaultUserOptions['usecodemirror'] = 1;
 # Enable bracket matching in CodeMirror
 $wgCodeMirrorEnableBracketMatching = true;
 # Enable accessible colors in CodeMirror
 $wgCodeMirrorAccessibilityColors = true;
 #Enable line numbering in CodeMirror
 #defaults to the template namespace `[ NS_TEMPLATE ]`
 #`null` enables it for all namespace
 #[] for disabling everywhere
 $wgCodeMirrorLineNumberingNamespaces = [];

How exactly a user can disable CodeMirror?

MediaWiki 1.36.1, PHP 7.4.15 (cgi-fcgi), MySQL 5.7.28-log, ICU 60.2, Apache 2.4.29-1ubuntu4.16 Extensions: Echo – (1a15ef8), VisualEditor 0.1.2, MyVariables 3.5.1, NoTitle 0.4.0 (780dbb6), DynamicSidebar 1.1 (b2f3feb), Lockdown – (2409546), MassMessage0.4.0 (c9b6e87), CodeMirror4.0.0 (508b9f6) 15:59, 22 July 2021.

Maksim E. Otstavnov (talkcontribs)

...Just toggling syntax highlight button when editing a particular page?

Thiemo Kreuz (WMDE) (talkcontribs)

Do you ask the question for Wikipedia or another Wikimedia wiki, or for a wiki you own and maintain? The short answer is yes. Users don't have to use syntax highlighting. Even if it's enabled by default, every user can disable it (both in VisualEditor's 2017 wikitext editor as well as in the older 2010 wikitext editor). It will stay disabled for this user then.

Maksim E. Otstavnov (talkcontribs)

I meant my instance of MediaWiki, and I was in search for the option at Preferences. I suggest mentioning the toggle in the extension page Extension:CodeMirror.

Thank you!

Reply to "Disabling CodeMirror by a user"