Configuration for the MediaWiki highlighting mode for CodeMirror.
This is a separate class mainly to keep static configuration out of
the logic in CodeMirrorModeMediaWiki
.
Classes
Example
// within MediaWiki:
const { mwModeConfig } = require( 'ext.CodeMirror.v6.mode.mediawiki' );
// Reference tags by their constants in the tags property.
if ( tag === mwModeConfig.tags.htmlTagBracket ) {
// …
}
- Source:
Properties
CodeMirrorModeMediaWikiConfig :Object.<string>inner
#
Mapping of MediaWiki-esque token identifiers to standardized lezer highlighting tags. Values are one of the default highlighting tags. The idea is to use as many default tags as possible so that theming (such as dark mode) can be applied with minimal effort. The semantic meaning of the tag may not really match how it is used, but as per CodeMirror docs, this is fine. It's still better to make use of the standard tags in some way.
Once we allow use of other themes, we may want to tweak these values for aesthetic reasons. The values here can freely be changed. The actual CSS class used is defined further down in highlightStyle().
Type:
- Object.<string>
Mapping of MediaWiki-esque token identifiers to standardized lezer highlighting tags.