@bhsd/codemirror-mediawiki 2.1.11 → 2.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/dist/codemirror.d.ts +1 -1
- package/dist/main.min.js +12 -12
- package/dist/main.min.js.map +3 -3
- package/dist/mw.min.js +2 -0
- package/dist/mw.min.js.map +7 -0
- package/mediawiki.css +25 -25
- package/mw/base.ts +199 -0
- package/mw/config.ts +148 -0
- package/mw/openLinks.ts +36 -0
- package/mw/textSelection.ts +54 -0
- package/package.json +14 -13
- package/src/codemirror.ts +74 -44
- package/src/mediawiki.ts +1 -1
- package/mw/dist/base.js +0 -265
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ Get the default linting function, which can be used as the argument of [`lint`](
|
|
|
122
122
|
|
|
123
123
|
```js
|
|
124
124
|
const linter = await cm.getLinter(); // default linter configuration
|
|
125
|
-
const linterMediawiki = await cm.getLinter({include}); // wikilint configuration
|
|
125
|
+
const linterMediawiki = await cm.getLinter({include: true, i18n: 'zh-hans'}); // wikilint configuration
|
|
126
126
|
const linterJavaScript = await cm.getLinter({env, parserOptions, rules}); // ESLint configuration
|
|
127
127
|
const linterCSS = await cm.getLinter({rules}); // Stylelint configuration
|
|
128
128
|
```
|
|
@@ -161,19 +161,28 @@ cm.lint(doc => [
|
|
|
161
161
|
|
|
162
162
|
*version added: 2.0.9*
|
|
163
163
|
|
|
164
|
-
**param**: `string
|
|
164
|
+
**param**: `string[] | Record<string, boolean>` the preferred [CodeMirror extensions](https://codemirror.net/docs/extensions/)
|
|
165
165
|
Set the preferred CodeMirror extensions.
|
|
166
166
|
|
|
167
167
|
```js
|
|
168
168
|
cm.prefer([
|
|
169
|
+
'allowMultipleSelections',
|
|
169
170
|
'bracketMatching',
|
|
170
171
|
'closeBrackets',
|
|
171
172
|
'highlightActiveLine',
|
|
172
173
|
'highlightSpecialChars',
|
|
173
174
|
'highlightWhitespace',
|
|
174
175
|
'highlightTrailingWhitespace',
|
|
175
|
-
'allowMultipleSelections',
|
|
176
176
|
]);
|
|
177
|
+
cm.prefer({
|
|
178
|
+
allowMultipleSelections: false,
|
|
179
|
+
bracketMatching: false,
|
|
180
|
+
closeBrackets: false,
|
|
181
|
+
highlightActiveLine: false,
|
|
182
|
+
highlightSpecialChars: false,
|
|
183
|
+
highlightWhitespace: false,
|
|
184
|
+
highlightTrailingWhitespace: false,
|
|
185
|
+
});
|
|
177
186
|
```
|
|
178
187
|
|
|
179
188
|
</details>
|