This website requires JavaScript.
Explore
Help
Register
Sign In
wikimedia
/
mediawiki-extensions-CodeMirror
Watch
1
Star
0
Fork
You've already forked mediawiki-extensions-CodeMirror
0
mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced
2024-12-04 02:28:14 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
10c9a9ee6f
mediawiki-extensions-CodeMi...
/
.babelrc
5 lines
95 B
Plaintext
Raw
Normal View
History
Unescape
Escape
CodeMirror6: add new modules, feature flag, and URL query parameter Add a new $wgCodeMirrorV6 temporary feature flag that when enabled, will load the 'ext.CodeMirror.v6.WikiEditor' module that is built against CodeMirror 6. You can also pass in the ?cm6enable=1 query parameter to force use of CodeMirror 6. This is currently only implemented for the 2010 editor. Due to packaging constraints with CodeMirror 6, we now use Webpack to bundle the files, which are then used by ResourceLoader. This is similar to what is done for Extension:Popups, MobileFrontend, among other extensions. A new generic class CodeMirror can be used on other areas where syntax highlighting is desirable, but not necessarily for editing (i.e. without WikiEditor). This commit merely lays the foundation for CodeMirror 6 and updates WikiEditor to use it. The actual MediaWiki syntax highlighting will come with a future commit. With the new Webpack build, the Gruntfile was removed and the tasks moved to npm commands. Bug: T317243 Change-Id: I2239d2449b2db3b638551f847eb4eff1aafa6276
2023-09-19 17:59:29 +00:00
{
Implement core MediaWiki stream parser for CodeMirror 6 This is more or less a exact port of the old stream parser, with the big notable change being that all configuration-related code lives in a separate class, CodeMirrorModeMediaWikiConfig. A smaller change is that closing HTML tags that are marked as errors now have the ending '>' character highlighted red, when it didn't before. Integration with other extensions and modes is saved for a future patch (T348684). This means <nowiki>, <ref> and other extension-supplied markup is not yet highlighted. The entry point for WikiEditor integration is now at ext.CodeMirror.v6.WikiEditor.init.js, which needs to first require the virtual file set via the DataScript (PHP) class. This can't be integrated into the CM6 code because it needs to be precompiled before ResourceLoader can use it (T281781). Known issues, to be addressed separately: * No support for TagModes / PluginModes (T348684) * Identical adjacent tokens produce excess markup (T352917) * Section headings do not have line-level styling (T351686) Bug: T348019 Change-Id: I8f8a81f362bed60dea14ecde9487a2b0c89225e8
2023-12-06 18:49:40 +00:00
"presets": ["@babel/preset-env"],
"plugins": ["@babel/plugin-transform-private-methods"]
CodeMirror6: add new modules, feature flag, and URL query parameter Add a new $wgCodeMirrorV6 temporary feature flag that when enabled, will load the 'ext.CodeMirror.v6.WikiEditor' module that is built against CodeMirror 6. You can also pass in the ?cm6enable=1 query parameter to force use of CodeMirror 6. This is currently only implemented for the 2010 editor. Due to packaging constraints with CodeMirror 6, we now use Webpack to bundle the files, which are then used by ResourceLoader. This is similar to what is done for Extension:Popups, MobileFrontend, among other extensions. A new generic class CodeMirror can be used on other areas where syntax highlighting is desirable, but not necessarily for editing (i.e. without WikiEditor). This commit merely lays the foundation for CodeMirror 6 and updates WikiEditor to use it. The actual MediaWiki syntax highlighting will come with a future commit. With the new Webpack build, the Gruntfile was removed and the tasks moved to npm commands. Bug: T317243 Change-Id: I2239d2449b2db3b638551f847eb4eff1aafa6276
2023-09-19 17:59:29 +00:00
}
Reference in a new issue
Copy permalink