**Background**
Other extensions can register tags to be syntax highlighted wherever CodeMirror is used. This is done using [[ https://www.mediawiki.org/wiki/Manual:Extension_registration#Attributes | extension attributes ]], whereby in an extension.json, you can specify `CodeMirrorTagModes` with an object having the tag name as the key, and the value being the MIME content type for which we want syntax highlighted. For example, the Cite extension registers its `<ref>` tag to be highlighted with [[ https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/348673/5/extension.json | like the following ]]:
```lang=json
"CodeMirrorTagModes": {
"ref": "text/mediawiki"
}
```
If you need a language other than the default (text/mediawiki), you need to also register a `CodeMirrorPluginModules`. For example, #mediawiki-extensions-phptags does this with the following:
```lang=json
"CodeMirrorTagModes": {
"phptag": "text/x-php"
},
"CodeMirrorPluginModules": [
"ext.CodeMirror.lib.mode.php"
]
```
This task is to track the work that goes into making this system work in CodeMirror 6, which is [[ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules | JavaScript module-based ]] (as opposed to CommonJS-style that ResourceLoader supports). At minimum, we need new pre-packaged ResourceLoader modules for each language that we offer. How they will tie into the main CodeMirror module is still under investigation.
**Acceptance criteria**
TBD* Any extension that supplies a `CodeMirrorTagModes` for `text/mediawiki` (or just `mediawiki`) should highlight the specified tag, and highlight the contents therein like normal wikitext.
* Support for languages other than MediaWiki wikitext will be saved for a separate task, and likewise for PluginModes.