@bhsd/codemirror-mediawiki 3.0.3 → 3.2.0
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 +400 -14
- package/dist/codemirror.d.ts +29 -26
- package/dist/codemirror.js +42 -175
- package/dist/color.d.ts +1 -1
- package/dist/color.js +14 -16
- package/dist/css.d.ts +2 -0
- package/dist/css.js +3 -2
- package/dist/demo.min.js +37 -0
- package/dist/escape.d.ts +3 -2
- package/dist/escape.js +76 -4
- package/dist/fold.d.ts +3 -52
- package/dist/fold.js +11 -12
- package/dist/html.d.ts +4 -0
- package/dist/html.js +31 -0
- package/dist/indent.js +1 -1
- package/dist/index.d.ts +102 -0
- package/dist/index.js +340 -0
- package/dist/linter.js +18 -6
- package/dist/lintsource.d.ts +3 -1
- package/dist/lintsource.js +46 -29
- package/dist/main.min.js +25 -25
- package/dist/mediawiki.d.ts +0 -5
- package/dist/mediawiki.js +0 -75
- package/dist/mw.min.js +30 -30
- package/dist/static.d.ts +0 -4
- package/dist/static.js +0 -4
- package/dist/statusBar.d.ts +2 -1
- package/dist/statusBar.js +59 -38
- package/dist/token.d.ts +0 -3
- package/dist/token.js +1 -12
- package/dist/vue.js +2 -2
- package/dist/wiki.min.js +29 -29
- package/i18n/en.json +3 -3
- package/i18n/zh-hans.json +3 -3
- package/i18n/zh-hant.json +3 -3
- package/package.json +16 -14
package/README.md
CHANGED
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
[](https://www.npmjs.com/package/@bhsd/codemirror-mediawiki)
|
|
3
3
|
[](https://app.codacy.com/gh/bhsd-harry/codemirror-mediawiki/dashboard)
|
|
4
4
|
|
|
5
|
+
# @bhsd/codemirror-mediawiki
|
|
6
|
+
|
|
7
|
+
This repository contains a modified version of the frontend scripts and styles from [MediaWiki extension CodeMirror](https://www.mediawiki.org/wiki/Extension:CodeMirror). The goal is to support a standalone integration between [CodeMirror](https://codemimrror.net) and [Wikitext](https://www.mediawiki.org/wiki/Wikitext), without the need for a [MediaWiki environment](https://doc.wikimedia.org/mediawiki-core/master/js/).
|
|
8
|
+
|
|
9
|
+
Here is a [demo](https://bhsd-harry.github.io/codemirror-mediawiki). To experiment with the RTL (right-to-left) support, you can append `?rtl=1` to the URL.
|
|
10
|
+
|
|
11
|
+
Nonetheless, this repository also provides a customized version with additional functionality for use on a MediaWiki site. Browser editing tools such as [Wikiplus-highlight](https://www.npmjs.com/package/wikiplus-highlight) and an [InPageEdit plugin](https://github.com/inpageedit/Plugins/blob/master/src/plugins/code-mirror/cm6.js) are built upon it. Please refer to a separate [README](./mw/README.md) file for the information.
|
|
12
|
+
|
|
5
13
|
<details>
|
|
6
14
|
<summary>Expand</summary>
|
|
7
15
|
|
|
8
|
-
- [Description](#description)
|
|
9
16
|
- [Installation](#installation)
|
|
10
17
|
- [Browser Usage](#browser-usage)
|
|
11
|
-
- [JavaScript](#javascript)
|
|
12
|
-
- [CSS](#css)
|
|
18
|
+
- [Download JavaScript](#download-javascript)
|
|
19
|
+
- [Download CSS](#download-css)
|
|
13
20
|
- [Language modes](#language-modes)
|
|
14
21
|
- [css](#css)
|
|
15
22
|
- [html](#html)
|
|
@@ -68,14 +75,6 @@
|
|
|
68
75
|
|
|
69
76
|
</details>
|
|
70
77
|
|
|
71
|
-
# Description
|
|
72
|
-
|
|
73
|
-
This repository contains a modified version of the frontend scripts and styles from [MediaWiki extension CodeMirror](https://www.mediawiki.org/wiki/Extension:CodeMirror). The goal is to support a standalone integration between [CodeMirror](https://codemimrror.net) and [Wikitext](https://www.mediawiki.org/wiki/Wikitext), without the need for a [MediaWiki environment](https://doc.wikimedia.org/mediawiki-core/master/js/).
|
|
74
|
-
|
|
75
|
-
Here is a [demo](https://bhsd-harry.github.io/codemirror-mediawiki). To experiment with the RTL (right-to-left) support, you can append `?rtl=1` to the URL.
|
|
76
|
-
|
|
77
|
-
Nonetheless, this repository also provides a customized version with additional functionality for use on a MediaWiki site. Browser editing tools such as [Wikiplus-highlight](https://github.com/bhsd-harry/Wikiplus-highlight) and an [InPageEdit plugin](https://github.com/inpageedit/Plugins) are built upon it. Please refer to a separate [README](./mw/README.md) file for the information.
|
|
78
|
-
|
|
79
78
|
# Installation
|
|
80
79
|
|
|
81
80
|
You can install the package via npm and import it as a module:
|
|
@@ -101,7 +100,10 @@ import {
|
|
|
101
100
|
|
|
102
101
|
You can download the code via CDN, for example:
|
|
103
102
|
|
|
104
|
-
## JavaScript
|
|
103
|
+
## Download JavaScript
|
|
104
|
+
|
|
105
|
+
<details>
|
|
106
|
+
<summary>Expand</summary>
|
|
105
107
|
|
|
106
108
|
```js
|
|
107
109
|
// static import
|
|
@@ -163,7 +165,12 @@ const {
|
|
|
163
165
|
} = await import('https://unpkg.com/@bhsd/codemirror-mediawiki');
|
|
164
166
|
```
|
|
165
167
|
|
|
166
|
-
|
|
168
|
+
</details>
|
|
169
|
+
|
|
170
|
+
## Download CSS
|
|
171
|
+
|
|
172
|
+
<details>
|
|
173
|
+
<summary>Expand</summary>
|
|
167
174
|
|
|
168
175
|
```html
|
|
169
176
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/mediawiki.css">
|
|
@@ -175,10 +182,15 @@ or
|
|
|
175
182
|
<link rel="stylesheet" href="https://unpkg.com/@bhsd/codemirror-mediawiki/mediawiki.css">
|
|
176
183
|
```
|
|
177
184
|
|
|
185
|
+
</details>
|
|
186
|
+
|
|
178
187
|
# Language modes
|
|
179
188
|
|
|
180
189
|
## css
|
|
181
190
|
|
|
191
|
+
<details>
|
|
192
|
+
<summary>Expand</summary>
|
|
193
|
+
|
|
182
194
|
The CSS mode contains a [dialect](#dialect) for [Extension:TemplateStyles](https://www.mediawiki.org/wiki/Extension:TemplateStyles). You can bundle the CSS mode by importing the `registerCSS` function:
|
|
183
195
|
|
|
184
196
|
```js
|
|
@@ -186,8 +198,27 @@ import {registerCSS} from '@bhsd/codemirror-mediawiki';
|
|
|
186
198
|
registerCSS();
|
|
187
199
|
```
|
|
188
200
|
|
|
201
|
+
If you want a more granular control over the extensions, you can import the `registerCSSCore` function and the desired extensions:
|
|
202
|
+
|
|
203
|
+
```js
|
|
204
|
+
import {registerCSSCore} from '@bhsd/codemirror-mediawiki';
|
|
205
|
+
registerCSSCore();
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
In addition to the common [extensions](#extensions), here are some CSS-specific extensions. Note that these extensions may not take effect if the corresponding common extensions are not registered:
|
|
209
|
+
|
|
210
|
+
```js
|
|
211
|
+
import {registerColorPickerForCSS} from '@bhsd/codemirror-mediawiki';
|
|
212
|
+
registerColorPickerForCSS();
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
</details>
|
|
216
|
+
|
|
189
217
|
## html
|
|
190
218
|
|
|
219
|
+
<details>
|
|
220
|
+
<summary>Expand</summary>
|
|
221
|
+
|
|
191
222
|
This is a mixed MediaWiki-HTML mode, which is used for [Extension:Widgets](https://www.mediawiki.org/wiki/Extension:Widgets). You can bundle the HTML mode by importing the `registerHTML` function:
|
|
192
223
|
|
|
193
224
|
```js
|
|
@@ -195,8 +226,31 @@ import {registerHTML} from '@bhsd/codemirror-mediawiki';
|
|
|
195
226
|
registerHTML();
|
|
196
227
|
```
|
|
197
228
|
|
|
229
|
+
If you want a more granular control over the extensions, you can import the `registerHTMLCore` function and the desired extensions:
|
|
230
|
+
|
|
231
|
+
```js
|
|
232
|
+
import {registerHTMLCore} from '@bhsd/codemirror-mediawiki';
|
|
233
|
+
registerHTMLCore();
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
In addition to the common [extensions](#extensions), here are some HTML-specific extensions. Note that these extensions may not take effect if the corresponding common extensions are not registered:
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
import {
|
|
240
|
+
registerCloseBracketsForHTML,
|
|
241
|
+
registerColorPickerForHTML,
|
|
242
|
+
} from '@bhsd/codemirror-mediawiki';
|
|
243
|
+
registerCloseBracketsForHTML();
|
|
244
|
+
registerColorPickerForHTML();
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
</details>
|
|
248
|
+
|
|
198
249
|
## javascript
|
|
199
250
|
|
|
251
|
+
<details>
|
|
252
|
+
<summary>Expand</summary>
|
|
253
|
+
|
|
200
254
|
You can bundle the JavaScript mode by importing the `registerJavaScript` function:
|
|
201
255
|
|
|
202
256
|
```js
|
|
@@ -204,8 +258,20 @@ import {registerJavaScript} from '@bhsd/codemirror-mediawiki';
|
|
|
204
258
|
registerJavaScript();
|
|
205
259
|
```
|
|
206
260
|
|
|
261
|
+
If you want a more granular control over the extensions, you can import the `registerJavaScriptCore` function and the desired extensions:
|
|
262
|
+
|
|
263
|
+
```js
|
|
264
|
+
import {registerJavaScriptCore} from '@bhsd/codemirror-mediawiki';
|
|
265
|
+
registerJavaScriptCore();
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
</details>
|
|
269
|
+
|
|
207
270
|
## json
|
|
208
271
|
|
|
272
|
+
<details>
|
|
273
|
+
<summary>Expand</summary>
|
|
274
|
+
|
|
209
275
|
You can bundle the JSON mode by importing the `registerJSON` function:
|
|
210
276
|
|
|
211
277
|
```js
|
|
@@ -213,8 +279,20 @@ import {registerJSON} from '@bhsd/codemirror-mediawiki';
|
|
|
213
279
|
registerJSON();
|
|
214
280
|
```
|
|
215
281
|
|
|
282
|
+
If you want a more granular control over the extensions, you can import the `registerJSONCore` function and the desired extensions:
|
|
283
|
+
|
|
284
|
+
```js
|
|
285
|
+
import {registerJSONCore} from '@bhsd/codemirror-mediawiki';
|
|
286
|
+
registerJSONCore();
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
</details>
|
|
290
|
+
|
|
216
291
|
## lua
|
|
217
292
|
|
|
293
|
+
<details>
|
|
294
|
+
<summary>Expand</summary>
|
|
295
|
+
|
|
218
296
|
You can bundle the Lua mode by importing the `registerLua` function:
|
|
219
297
|
|
|
220
298
|
```js
|
|
@@ -222,8 +300,20 @@ import {registerLua} from '@bhsd/codemirror-mediawiki';
|
|
|
222
300
|
registerLua();
|
|
223
301
|
```
|
|
224
302
|
|
|
303
|
+
If you want a more granular control over the extensions, you can import the `registerLuaCore` function and the desired extensions:
|
|
304
|
+
|
|
305
|
+
```js
|
|
306
|
+
import {registerLuaCore} from '@bhsd/codemirror-mediawiki';
|
|
307
|
+
registerLuaCore();
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
</details>
|
|
311
|
+
|
|
225
312
|
## mediawiki
|
|
226
313
|
|
|
314
|
+
<details>
|
|
315
|
+
<summary>Expand</summary>
|
|
316
|
+
|
|
227
317
|
You can bundle the MediaWiki mode by importing the `registerMediaWiki` function:
|
|
228
318
|
|
|
229
319
|
```js
|
|
@@ -231,8 +321,33 @@ import {registerMediaWiki} from '@bhsd/codemirror-mediawiki';
|
|
|
231
321
|
registerMediaWiki();
|
|
232
322
|
```
|
|
233
323
|
|
|
324
|
+
If you want a more granular control over the extensions, you can import the `registerMediaWikiCore` function and the desired extensions:
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
import {registerMediaWikiCore} from '@bhsd/codemirror-mediawiki';
|
|
328
|
+
registerMediaWikiCore();
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
In addition to the common [extensions](#extensions), here are some MediaWiki-specific extensions. Note that these extensions may not take effect if the corresponding common extensions are not registered:
|
|
332
|
+
|
|
333
|
+
```js
|
|
334
|
+
import {
|
|
335
|
+
registerColorPickerForMediaWiki,
|
|
336
|
+
registerBracketMatchingForMediaWiki,
|
|
337
|
+
registerCodeFoldingForMediaWiki
|
|
338
|
+
} from '@bhsd/codemirror-mediawiki';
|
|
339
|
+
registerColorPickerForMediaWiki();
|
|
340
|
+
registerBracketMatchingForMediaWiki();
|
|
341
|
+
registerCodeFoldingForMediaWiki();
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
</details>
|
|
345
|
+
|
|
234
346
|
## vue
|
|
235
347
|
|
|
348
|
+
<details>
|
|
349
|
+
<summary>Expand</summary>
|
|
350
|
+
|
|
236
351
|
You can bundle the Vue mode by importing the `registerVue` function:
|
|
237
352
|
|
|
238
353
|
```js
|
|
@@ -240,8 +355,31 @@ import {registerVue} from '@bhsd/codemirror-mediawiki';
|
|
|
240
355
|
registerVue();
|
|
241
356
|
```
|
|
242
357
|
|
|
358
|
+
If you want a more granular control over the extensions, you can import the `registerVueCore` function and the desired extensions:
|
|
359
|
+
|
|
360
|
+
```js
|
|
361
|
+
import {registerVueCore} from '@bhsd/codemirror-mediawiki';
|
|
362
|
+
registerVueCore();
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
In addition to the common [extensions](#extensions), here are some Vue-specific extensions. Note that these extensions may not take effect if the corresponding common extensions are not registered:
|
|
366
|
+
|
|
367
|
+
```js
|
|
368
|
+
import {
|
|
369
|
+
registerCloseBracketsForVue,
|
|
370
|
+
registerColorPickerForVue,
|
|
371
|
+
} from '@bhsd/codemirror-mediawiki';
|
|
372
|
+
registerCloseBracketsForVue();
|
|
373
|
+
registerColorPickerForVue();
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
</details>
|
|
377
|
+
|
|
243
378
|
## Other languages
|
|
244
379
|
|
|
380
|
+
<details>
|
|
381
|
+
<summary>Expand</summary>
|
|
382
|
+
|
|
245
383
|
You can also register other languages by importing the `registerLanguage` function:
|
|
246
384
|
|
|
247
385
|
```js
|
|
@@ -250,6 +388,16 @@ import {python} from '@codemirror/lang-python';
|
|
|
250
388
|
registerLanguage('python', python);
|
|
251
389
|
```
|
|
252
390
|
|
|
391
|
+
If you want a more granular control over the extensions, you can import the `registerLanguageCore` function and the desired extensions:
|
|
392
|
+
|
|
393
|
+
```js
|
|
394
|
+
import {registerLanguageCore} from '@bhsd/codemirror-mediawiki';
|
|
395
|
+
import {python} from '@codemirror/lang-python';
|
|
396
|
+
registerLanguageCore('python', python);
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
</details>
|
|
400
|
+
|
|
253
401
|
# Constructor
|
|
254
402
|
|
|
255
403
|
<details>
|
|
@@ -404,6 +552,23 @@ const tree = cm.getNodeAt(0);
|
|
|
404
552
|
|
|
405
553
|
</details>
|
|
406
554
|
|
|
555
|
+
## hasPreference
|
|
556
|
+
|
|
557
|
+
<details>
|
|
558
|
+
<summary>Expand</summary>
|
|
559
|
+
|
|
560
|
+
*version added: 3.2.0*
|
|
561
|
+
|
|
562
|
+
**param**: `string` extension name
|
|
563
|
+
**returns**: `boolean`
|
|
564
|
+
Check if the editor enables the given extension.
|
|
565
|
+
|
|
566
|
+
```js
|
|
567
|
+
const hasAutocompletion = cm.hasPreference('autocompletion');
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
</details>
|
|
571
|
+
|
|
407
572
|
## initialize
|
|
408
573
|
|
|
409
574
|
<details>
|
|
@@ -470,7 +635,7 @@ cm.localize({
|
|
|
470
635
|
|
|
471
636
|
*version added: 2.0.9*
|
|
472
637
|
|
|
473
|
-
**param**: `string[] | Record<string, boolean>` the
|
|
638
|
+
**param**: `string[] | Record<string, boolean>` the [extensions](#extensions) to enable
|
|
474
639
|
Set the preferred CodeMirror extensions. Available extensions are introduced [later](#extensions).
|
|
475
640
|
|
|
476
641
|
```js
|
|
@@ -681,30 +846,81 @@ CodeMirror6.replaceSelections(cm.view, str => str.toUpperCase());
|
|
|
681
846
|
|
|
682
847
|
## allowMultipleSelections
|
|
683
848
|
|
|
849
|
+
<details>
|
|
850
|
+
<summary>Expand</summary>
|
|
851
|
+
|
|
684
852
|
*version added: 2.1.11*
|
|
685
853
|
|
|
686
854
|
Allow multiple selections. This extension also enables rectangular selections by holding down the `Alt` key.
|
|
687
855
|
|
|
856
|
+
For granular control over the bundled extensions, you can import the `registerAllowMultipleSelections` function:
|
|
857
|
+
|
|
858
|
+
```js
|
|
859
|
+
import {registerAllowMultipleSelections} from '@bhsd/codemirror-mediawiki';
|
|
860
|
+
registerAllowMultipleSelections();
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
</details>
|
|
864
|
+
|
|
688
865
|
## autocompletion
|
|
689
866
|
|
|
867
|
+
<details>
|
|
868
|
+
<summary>Expand</summary>
|
|
869
|
+
|
|
690
870
|
*version added: 2.5.1*
|
|
691
871
|
|
|
692
872
|
Provide autocompletion for MediaWiki, CSS and JavaScript modes.
|
|
693
873
|
|
|
874
|
+
For granular control over the bundled extensions, you can import the `registerAutocompletion` function:
|
|
875
|
+
|
|
876
|
+
```js
|
|
877
|
+
import {registerAutocompletion} from '@bhsd/codemirror-mediawiki';
|
|
878
|
+
registerAutocompletion();
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
</details>
|
|
882
|
+
|
|
694
883
|
## bracketMatching
|
|
695
884
|
|
|
885
|
+
<details>
|
|
886
|
+
<summary>Expand</summary>
|
|
887
|
+
|
|
696
888
|
*version added: 2.0.9*
|
|
697
889
|
|
|
698
890
|
Matched or unmatched brackets or tags are highlighted in cyan or dark red when the cursor is next to them.
|
|
699
891
|
|
|
892
|
+
For granular control over the bundled extensions, you can import the `registerBracketMatching` function:
|
|
893
|
+
|
|
894
|
+
```js
|
|
895
|
+
import {registerBracketMatching} from '@bhsd/codemirror-mediawiki';
|
|
896
|
+
registerBracketMatching();
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
</details>
|
|
900
|
+
|
|
700
901
|
## closeBrackets
|
|
701
902
|
|
|
903
|
+
<details>
|
|
904
|
+
<summary>Expand</summary>
|
|
905
|
+
|
|
702
906
|
*version added: 2.0.9*
|
|
703
907
|
|
|
704
908
|
Automatically close brackets (`{`, `[` and `(`) and quotes (`"`, and `'` except for the MediaWiki mode).
|
|
705
909
|
|
|
910
|
+
For granular control over the bundled extensions, you can import the `registerCloseBrackets` function:
|
|
911
|
+
|
|
912
|
+
```js
|
|
913
|
+
import {registerCloseBrackets} from '@bhsd/codemirror-mediawiki';
|
|
914
|
+
registerCloseBrackets();
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
</details>
|
|
918
|
+
|
|
706
919
|
## codeFolding
|
|
707
920
|
|
|
921
|
+
<details>
|
|
922
|
+
<summary>Expand</summary>
|
|
923
|
+
|
|
708
924
|
*version added: 2.3.0*
|
|
709
925
|
|
|
710
926
|
Fold sections, templates, parser functions and extension tags in the MediaWiki mode, and code blocks in other modes.
|
|
@@ -716,14 +932,38 @@ Key bindings:
|
|
|
716
932
|
- `Ctrl` + `Alt` + `[`: Fold all
|
|
717
933
|
- `Ctrl` + `Alt` + `]`: Unfold all
|
|
718
934
|
|
|
935
|
+
For granular control over the bundled extensions, you can import the `registerCodeFolding` function:
|
|
936
|
+
|
|
937
|
+
```js
|
|
938
|
+
import {registerCodeFolding} from '@bhsd/codemirror-mediawiki';
|
|
939
|
+
registerCodeFolding();
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
</details>
|
|
943
|
+
|
|
719
944
|
## colorPicker
|
|
720
945
|
|
|
946
|
+
<details>
|
|
947
|
+
<summary>Expand</summary>
|
|
948
|
+
|
|
721
949
|
*version added: 2.18.0*
|
|
722
950
|
|
|
723
951
|
Provide color pickers for CSS and MediaWiki modes.
|
|
724
952
|
|
|
953
|
+
For granular control over the bundled extensions, you can import the `registerColorPicker` functions. Note that you also need to register this extension for specific languages([CSS](#css), [MediaWiki](#mediawiki) or [Vue](#vue)):
|
|
954
|
+
|
|
955
|
+
```js
|
|
956
|
+
import {registerColorPicker} from '@bhsd/codemirror-mediawiki';
|
|
957
|
+
registerColorPicker();
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
</details>
|
|
961
|
+
|
|
725
962
|
## escape
|
|
726
963
|
|
|
964
|
+
<details>
|
|
965
|
+
<summary>Expand</summary>
|
|
966
|
+
|
|
727
967
|
*version added: 2.2.2*
|
|
728
968
|
|
|
729
969
|
Key bindings:
|
|
@@ -731,72 +971,216 @@ Key bindings:
|
|
|
731
971
|
- `Ctrl`/`Cmd` + `[`: Escape the selected text with HTML entities
|
|
732
972
|
- `Ctrl`/`Cmd` + `]`: Escape the selected text with URL encoding
|
|
733
973
|
|
|
974
|
+
For granular control over the bundled extensions, you can import the `registerEscape` function:
|
|
975
|
+
|
|
976
|
+
```js
|
|
977
|
+
import {registerEscape} from '@bhsd/codemirror-mediawiki';
|
|
978
|
+
registerEscape();
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
</details>
|
|
982
|
+
|
|
734
983
|
## highlightActiveLine
|
|
735
984
|
|
|
985
|
+
<details>
|
|
986
|
+
<summary>Expand</summary>
|
|
987
|
+
|
|
736
988
|
Highlight the line the cursor is on in light cyan.
|
|
737
989
|
|
|
990
|
+
For granular control over the bundled extensions, you can import the `registerHighlightActiveLine` function:
|
|
991
|
+
|
|
992
|
+
```js
|
|
993
|
+
import {registerHighlightActiveLine} from '@bhsd/codemirror-mediawiki';
|
|
994
|
+
registerHighlightActiveLine();
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
</details>
|
|
998
|
+
|
|
738
999
|
## highlightSelectionMatches
|
|
739
1000
|
|
|
1001
|
+
<details>
|
|
1002
|
+
<summary>Expand</summary>
|
|
1003
|
+
|
|
740
1004
|
*version added: 2.15.3*
|
|
741
1005
|
|
|
742
1006
|
Highlight texts that match the selection in light green.
|
|
743
1007
|
|
|
1008
|
+
For granular control over the bundled extensions, you can import the `registerHighlightSelectionMatches` function:
|
|
1009
|
+
|
|
1010
|
+
```js
|
|
1011
|
+
import {registerHighlightSelectionMatches} from '@bhsd/codemirror-mediawiki';
|
|
1012
|
+
registerHighlightSelectionMatches();
|
|
1013
|
+
```
|
|
1014
|
+
|
|
1015
|
+
</details>
|
|
1016
|
+
|
|
744
1017
|
## highlightSpecialChars
|
|
745
1018
|
|
|
1019
|
+
<details>
|
|
1020
|
+
<summary>Expand</summary>
|
|
1021
|
+
|
|
746
1022
|
Show invisible characters as red dots.
|
|
747
1023
|
|
|
1024
|
+
For granular control over the bundled extensions, you can import the `registerHighlightSpecialChars` function:
|
|
1025
|
+
|
|
1026
|
+
```js
|
|
1027
|
+
import {registerHighlightSpecialChars} from '@bhsd/codemirror-mediawiki';
|
|
1028
|
+
registerHighlightSpecialChars();
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
</details>
|
|
1032
|
+
|
|
748
1033
|
## highlightTrailingWhitespace
|
|
749
1034
|
|
|
1035
|
+
<details>
|
|
1036
|
+
<summary>Expand</summary>
|
|
1037
|
+
|
|
750
1038
|
*version added: 2.0.9*
|
|
751
1039
|
|
|
752
1040
|
Highlight trailing whitespace in a red-orange color.
|
|
753
1041
|
|
|
1042
|
+
For granular control over the bundled extensions, you can import the `registerHighlightTrailingWhitespace` function:
|
|
1043
|
+
|
|
1044
|
+
```js
|
|
1045
|
+
import {registerHighlightTrailingWhitespace} from '@bhsd/codemirror-mediawiki';
|
|
1046
|
+
registerHighlightTrailingWhitespace();
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
</details>
|
|
1050
|
+
|
|
754
1051
|
## highlightWhitespace
|
|
755
1052
|
|
|
1053
|
+
<details>
|
|
1054
|
+
<summary>Expand</summary>
|
|
1055
|
+
|
|
756
1056
|
*version added: 2.0.12*
|
|
757
1057
|
|
|
758
1058
|
Show spaces and tabs as dots and arrows.
|
|
759
1059
|
|
|
1060
|
+
For granular control over the bundled extensions, you can import the `registerHighlightWhitespace` function:
|
|
1061
|
+
|
|
1062
|
+
```js
|
|
1063
|
+
import {registerHighlightWhitespace} from '@bhsd/codemirror-mediawiki';
|
|
1064
|
+
registerHighlightWhitespace();
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
</details>
|
|
1068
|
+
|
|
760
1069
|
## hover
|
|
761
1070
|
|
|
1071
|
+
<details>
|
|
1072
|
+
<summary>Expand</summary>
|
|
1073
|
+
|
|
762
1074
|
*version added: 2.21.1*
|
|
763
1075
|
|
|
764
1076
|
Show the help information of a magic word when hovering.
|
|
765
1077
|
|
|
1078
|
+
For granular control over the bundled extensions, you can import the `registerHover` function:
|
|
1079
|
+
|
|
1080
|
+
```js
|
|
1081
|
+
import {registerHover} from '@bhsd/codemirror-mediawiki';
|
|
1082
|
+
registerHover();
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
</details>
|
|
1086
|
+
|
|
766
1087
|
## inlayHints
|
|
767
1088
|
|
|
1089
|
+
<details>
|
|
1090
|
+
<summary>Expand</summary>
|
|
1091
|
+
|
|
768
1092
|
*version added: 2.22.0*
|
|
769
1093
|
|
|
770
1094
|
Show inlay hints for anonymous parameters.
|
|
771
1095
|
|
|
1096
|
+
For granular control over the bundled extensions, you can import the `registerInlayHints` function:
|
|
1097
|
+
|
|
1098
|
+
```js
|
|
1099
|
+
import {registerInlayHints} from '@bhsd/codemirror-mediawiki';
|
|
1100
|
+
registerInlayHints();
|
|
1101
|
+
```
|
|
1102
|
+
|
|
1103
|
+
</details>
|
|
1104
|
+
|
|
772
1105
|
## openLinks
|
|
773
1106
|
|
|
1107
|
+
<details>
|
|
1108
|
+
<summary>Expand</summary>
|
|
1109
|
+
|
|
774
1110
|
*version added: 2.19.6*
|
|
775
1111
|
|
|
776
1112
|
CTRL/CMD-click opens a link in a new tab.
|
|
777
1113
|
|
|
1114
|
+
For granular control over the bundled extensions, you can import the `registerOpenLinks` function:
|
|
1115
|
+
|
|
1116
|
+
```js
|
|
1117
|
+
import {registerOpenLinks} from '@bhsd/codemirror-mediawiki';
|
|
1118
|
+
registerOpenLinks();
|
|
1119
|
+
```
|
|
1120
|
+
|
|
1121
|
+
</details>
|
|
1122
|
+
|
|
778
1123
|
## refHover
|
|
779
1124
|
|
|
1125
|
+
<details>
|
|
1126
|
+
<summary>Expand</summary>
|
|
1127
|
+
|
|
780
1128
|
*version added: 2.17.1*
|
|
781
1129
|
|
|
782
1130
|
Show the content of the `<ref>` tag defined elsewhere when hovering.
|
|
783
1131
|
|
|
1132
|
+
For granular control over the bundled extensions, you can import the `registerRefHover` function:
|
|
1133
|
+
|
|
1134
|
+
```js
|
|
1135
|
+
import {registerRefHover} from '@bhsd/codemirror-mediawiki';
|
|
1136
|
+
registerRefHover();
|
|
1137
|
+
```
|
|
1138
|
+
|
|
1139
|
+
</details>
|
|
1140
|
+
|
|
784
1141
|
## scrollPastEnd
|
|
785
1142
|
|
|
1143
|
+
<details>
|
|
1144
|
+
<summary>Expand</summary>
|
|
1145
|
+
|
|
786
1146
|
*version added: 2.15.3*
|
|
787
1147
|
|
|
788
1148
|
Allow the editor to be scrolled down past the end of the document.
|
|
789
1149
|
|
|
1150
|
+
For granular control over the bundled extensions, you can import the `registerScrollPastEnd` function:
|
|
1151
|
+
|
|
1152
|
+
```js
|
|
1153
|
+
import {registerScrollPastEnd} from '@bhsd/codemirror-mediawiki';
|
|
1154
|
+
registerScrollPastEnd();
|
|
1155
|
+
```
|
|
1156
|
+
|
|
1157
|
+
</details>
|
|
1158
|
+
|
|
790
1159
|
## signatureHelp
|
|
791
1160
|
|
|
1161
|
+
<details>
|
|
1162
|
+
<summary>Expand</summary>
|
|
1163
|
+
|
|
792
1164
|
*version added: 2.21.1*
|
|
793
1165
|
|
|
794
1166
|
Show the parser function signature when typing.
|
|
795
1167
|
|
|
1168
|
+
For granular control over the bundled extensions, you can import the `registerSignatureHelp` function:
|
|
1169
|
+
|
|
1170
|
+
```js
|
|
1171
|
+
import {registerSignatureHelp} from '@bhsd/codemirror-mediawiki';
|
|
1172
|
+
registerSignatureHelp();
|
|
1173
|
+
```
|
|
1174
|
+
|
|
1175
|
+
</details>
|
|
1176
|
+
|
|
796
1177
|
# Known issues
|
|
797
1178
|
|
|
798
1179
|
## Syntax Highlighting
|
|
799
1180
|
|
|
1181
|
+
<details>
|
|
1182
|
+
<summary>Expand</summary>
|
|
1183
|
+
|
|
800
1184
|
### Extension
|
|
801
1185
|
|
|
802
1186
|
1. [Extension:Translate](https://www.mediawiki.org/wiki/Extension:Translate) is not supported.
|
|
@@ -829,3 +1213,5 @@ Show the parser function signature when typing.
|
|
|
829
1213
|
### Language conversion
|
|
830
1214
|
|
|
831
1215
|
1. BCP 47 language codes are not supported in language conversion ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#Explicit%20definition%20of%20language%20variant%20alternatives%20(BCP%2047%20codes))).
|
|
1216
|
+
|
|
1217
|
+
</details>
|