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)