Page MenuHomePhabricator

Enable CodeMirror for wikitext by default on all wikis
Open, MediumPublic

Description

T288161: Enable CodeMirror's Syntax Highlighting on English Wikipedia by default has as of October 2026 been live for several weeks, and to my knowledge we haven't received any complaints. The next natural step is to enable it by default on all wikis.

I'm not certain how much a global RfC will bring us. Such an RfC would not be advertised to the unregistered users who are actually affected. The only opposition we saw in the original 2021 RfC on English Wikipedia was because of performance, and that has largely been resolved now with the upgrade to CodeMirror 6, and the recent optimizations to the 2017 editor implementation (T432558). Our 2026 follow-up straw proposal saw no opposition. It seems users are generally content with it, provided they have a way to turn it off when needed.

We should give this a try and enable it everywhere by default, and just as with T288161, we'd only do this for new accounts and logged out users.

Even if we decide not to do this for the WMF cluster, I think we should have it enabled by default in the extension. It's already kind of weird that the extension ships with everything disabled. Let's get that done at least in time for MW 1.47.

Proposed changes

  • Set $wgConditionalUserOptions['usecodemirror'] on the WMF cluster, targeting only logged out users and users created after the date the config change is deployed.
    • Enwiki's conditional should stay at the date the same change was made there, 2026-09-14
  • Set the default value of the usecodemirror preference to 1 in extension.json (no effect on WMF cluster)

Event Timeline

Change #1352265 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] CodeMirrorPreferences: enable usecodemirror, remove colorblind option

https://gerrit.wikimedia.org/r/1352265

Change #1352274 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] selenium: correctly disable CodeMirror in edit.page.js object

https://gerrit.wikimedia.org/r/1352274

Change #1352288 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[operations/mediawiki-config@master] CommonSettings: ensure 'usecodemirror' user option is unset globally

https://gerrit.wikimedia.org/r/1352288

Change #1352303 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[operations/mediawiki-config@master] CommonSettings: remove redundant CodeMirror config settings

https://gerrit.wikimedia.org/r/1352303

Change #1352274 merged by jenkins-bot:

[mediawiki/core@master] selenium: correctly disable CodeMirror in edit.page.js object

https://gerrit.wikimedia.org/r/1352274

Change #1352265 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirrorPreferences: enable usecodemirror, remove colorblind option

https://gerrit.wikimedia.org/r/1352265

I spoke with Movement Comms about this. The plan is to announce this change is upcoming via Tech News, give communities a few weeks' time to give feedback, and then if all sounds OK we'll make the switch. I've gone ahead and made an entry in Tech News for the initial announcement: https://meta.wikimedia.org/w/index.php?diff=31140921

Change #1352288 merged by jenkins-bot:

[operations/mediawiki-config@master] CommonSettings: ensure 'usecodemirror' user option is unset globally

https://gerrit.wikimedia.org/r/1352288

Mentioned in SAL (#wikimedia-operations) [2026-10-12T19:01:08Z] <musikanimal@deploy1003> Started scap sync-world: Backport for [[gerrit:1352288|CommonSettings: ensure 'usecodemirror' user option is unset globally (T440077)]]

Mentioned in SAL (#wikimedia-operations) [2026-10-12T19:07:03Z] <musikanimal@deploy1003> musikanimal: Backport for [[gerrit:1352288|CommonSettings: ensure 'usecodemirror' user option is unset globally (T440077)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-10-12T19:14:19Z] <musikanimal@deploy1003> Finished scap sync-world: Backport for [[gerrit:1352288|CommonSettings: ensure 'usecodemirror' user option is unset globally (T440077)]] (duration: 13m 11s)

There is a near unanimous opposition on enwiki (in a few hours' discussion with a fair bunch of people commenting) against making this opt-out ; there's a strongly expressed preference for making it opt-in - see https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Was_'Enable_syntax_highlighting_for_wikitext'_suddenly_added_to_enwiki_as_opt-out?

See https://phabricator.wikimedia.org/T441308 where this has been reported as a bug, although my understanding is that it's a community bug: an (apparent) failure to consult with the community before imposing a major technical change.

Making it clear here as well to any readers that T440077#12438425 was a bad deploy on my part, and was nothing intentional. See T441308 for details. I deeply apologize and am well aware how sensitive and costly it is to force changes to existing editor workflows, being a long-term editor myself. This is why most everything under umbrella of CodeMirror has a means to turn it off. It's supposed to be kind of like an IDE, where we offer the power to do the otherwise impossible, but opt for configuration over forced convention.

Repeating what was said in the on-wiki discussion (permalink), each community can look forward to CommunityConfiguration-Adoption (T440078), then we don't need developer intervention to change the behaviour for new users. At any rate, whilst admitting my obvious bias, I want to emphasize the philosophy that existing users always prefer the workflows that they know to work well, while what is being proposed here is for a new generation of editors to be able to do the same work with modernized tooling (who will later complain if anything changes to it!). Such is the life of a Wikimedia editor 😛 The goal here for CodeMirror is simply to make that life a bit easier.

Change #1352303 merged by jenkins-bot:

[operations/mediawiki-config@master] CommonSettings: remove redundant CodeMirror config settings

https://gerrit.wikimedia.org/r/1352303

Mentioned in SAL (#wikimedia-operations) [2026-11-03T23:18:22Z] <musikanimal@deploy2003> Started scap sync-world: Backport for [[gerrit:1352303|CommonSettings: remove redundant CodeMirror config settings (T440077)]], [[gerrit:1358261|metawiki: Disable wish submissions on 2026-11-09 (17:00 UTC) (T442015)]]

Mentioned in SAL (#wikimedia-operations) [2026-11-03T23:22:46Z] <musikanimal@deploy2003> musikanimal, amdrel: Backport for [[gerrit:1352303|CommonSettings: remove redundant CodeMirror config settings (T440077)]], [[gerrit:1358261|metawiki: Disable wish submissions on 2026-11-09 (17:00 UTC) (T442015)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-11-03T23:33:19Z] <musikanimal@deploy2003> Finished scap sync-world: Backport for [[gerrit:1352303|CommonSettings: remove redundant CodeMirror config settings (T440077)]], [[gerrit:1358261|metawiki: Disable wish submissions on 2026-11-09 (17:00 UTC) (T442015)]] (duration: 14m 56s)