@bhsd/codemirror-mediawiki 3.9.2 → 3.10.1

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.
Files changed (67) hide show
  1. package/README.md +147 -87
  2. package/dist/bidi.d.ts +9 -8
  3. package/dist/bidi.js +38 -23
  4. package/dist/codemirror.d.ts +7 -0
  5. package/dist/codemirror.js +22 -9
  6. package/dist/color.d.ts +8 -5
  7. package/dist/color.js +5 -1
  8. package/dist/config.d.ts +1 -0
  9. package/dist/config.js +1 -0
  10. package/dist/constants.d.ts +3 -2
  11. package/dist/constants.js +3 -2
  12. package/dist/css.d.ts +5 -0
  13. package/dist/css.js +14 -6
  14. package/dist/escape.d.ts +22 -2
  15. package/dist/escape.js +44 -25
  16. package/dist/fold.d.ts +57 -5
  17. package/dist/fold.js +149 -58
  18. package/dist/hover.d.ts +16 -3
  19. package/dist/hover.js +84 -67
  20. package/dist/html.js +17 -12
  21. package/dist/indent.d.ts +7 -0
  22. package/dist/indent.js +7 -1
  23. package/dist/index.d.ts +54 -16
  24. package/dist/index.js +91 -38
  25. package/dist/inlay.d.ts +1 -1
  26. package/dist/inlay.js +26 -25
  27. package/dist/javascript.d.ts +10 -1
  28. package/dist/javascript.js +50 -2
  29. package/dist/keybindings.d.ts +1 -0
  30. package/dist/keybindings.js +1 -0
  31. package/dist/keymap.d.ts +11 -0
  32. package/dist/keymap.js +3 -4
  33. package/dist/linter.d.ts +31 -2
  34. package/dist/linter.js +10 -3
  35. package/dist/lintsource.d.ts +47 -3
  36. package/dist/lintsource.js +50 -11
  37. package/dist/lua.d.ts +0 -2
  38. package/dist/lua.js +27 -10
  39. package/dist/main.min.js +31 -29
  40. package/dist/matchBrackets.d.ts +16 -0
  41. package/dist/matchBrackets.js +16 -0
  42. package/dist/matchTag.d.ts +5 -2
  43. package/dist/matchTag.js +11 -7
  44. package/dist/mediawiki.d.ts +15 -2
  45. package/dist/mediawiki.js +59 -45
  46. package/dist/mw.min.js +33 -37
  47. package/dist/mwConfig.js +2 -2
  48. package/dist/openLinks.d.ts +12 -2
  49. package/dist/openLinks.js +64 -54
  50. package/dist/ref.d.ts +16 -2
  51. package/dist/ref.js +110 -95
  52. package/dist/signature.d.ts +7 -1
  53. package/dist/signature.js +53 -49
  54. package/dist/static.d.ts +4 -0
  55. package/dist/static.js +4 -0
  56. package/dist/statusBar.js +9 -8
  57. package/dist/theme.d.ts +1 -0
  58. package/dist/theme.js +8 -0
  59. package/dist/token.d.ts +29 -7
  60. package/dist/token.js +33 -18
  61. package/dist/util.d.ts +25 -2
  62. package/dist/util.js +47 -1
  63. package/dist/wiki.min.js +32 -36
  64. package/i18n/en.json +2 -2
  65. package/i18n/zh-hans.json +2 -2
  66. package/i18n/zh-hant.json +2 -2
  67. package/package.json +15 -13
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
+ # @bhsd/codemirror-mediawiki
2
+
1
3
  [![npm version](https://badge.fury.io/js/@bhsd%2Fcodemirror-mediawiki.svg)](https://www.npmjs.com/package/@bhsd/codemirror-mediawiki)
2
4
  [![CodeQL](https://github.com/bhsd-harry/codemirror-mediawiki/actions/workflows/codeql.yml/badge.svg)](https://github.com/bhsd-harry/codemirror-mediawiki/actions/workflows/codeql.yml)
3
5
  [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/%40bhsd/codemirror-mediawiki)](https://www.npmjs.com/package/@bhsd/codemirror-mediawiki)
4
6
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/972fd5f6684c4fd8ac2f26e01d349948)](https://app.codacy.com/gh/bhsd-harry/codemirror-mediawiki/dashboard)
5
7
 
6
- # @bhsd/codemirror-mediawiki
7
-
8
8
  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/).
9
9
 
10
10
  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.
@@ -19,6 +19,7 @@ If you are just looking for a CodeMirror 6 language mode and language support ex
19
19
  - [Installation](#installation)
20
20
  - [Browser Usage](#browser-usage)
21
21
  - [Language modes](#language-modes)
22
+ - [abusefilter](#abusefilter)
22
23
  - [css](#css)
23
24
  - [html](#html)
24
25
  - [javascript](#javascript)
@@ -64,6 +65,7 @@ If you are just looking for a CodeMirror 6 language mode and language support ex
64
65
  - [Extensions](#extensions)
65
66
  - [allowMultipleSelections](#allowmultipleselections)
66
67
  - [autocompletion](#autocompletion)
68
+ - [bidiIsolates](#bidiisolates)
67
69
  - [bracketMatching](#bracketmatching)
68
70
  - [closeBrackets](#closebrackets)
69
71
  - [codeFolding](#codefolding)
@@ -85,7 +87,7 @@ If you are just looking for a CodeMirror 6 language mode and language support ex
85
87
 
86
88
  </details>
87
89
 
88
- # Installation
90
+ ## Installation
89
91
 
90
92
  You can install the package via npm and import it as a module:
91
93
 
@@ -103,10 +105,11 @@ import {
103
105
  registerJSON,
104
106
  registerLua,
105
107
  registerVue,
108
+ registerAbuseFilter,
106
109
  } from '@bhsd/codemirror-mediawiki';
107
110
  ```
108
111
 
109
- # Browser Usage
112
+ ## Browser Usage
110
113
 
111
114
  <details>
112
115
  <summary>Expand</summary>
@@ -124,6 +127,7 @@ import {
124
127
  registerJSON,
125
128
  registerLua,
126
129
  registerVue,
130
+ registerAbuseFilter,
127
131
  } from 'https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki';
128
132
  ```
129
133
 
@@ -139,6 +143,7 @@ import {
139
143
  registerJSON,
140
144
  registerLua,
141
145
  registerVue,
146
+ registerAbuseFilter,
142
147
  } from 'https://unpkg.com/@bhsd/codemirror-mediawiki/dist/main.min.js';
143
148
  ```
144
149
 
@@ -155,6 +160,7 @@ const {
155
160
  registerJSON,
156
161
  registerLua,
157
162
  registerVue,
163
+ registerAbuseFilter,
158
164
  } = await import('https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki');
159
165
  ```
160
166
 
@@ -170,14 +176,38 @@ const {
170
176
  registerJSON,
171
177
  registerLua,
172
178
  registerVue,
179
+ registerAbuseFilter,
173
180
  } = await import('https://unpkg.com/@bhsd/codemirror-mediawiki/dist/main.min.js');
174
181
  ```
175
182
 
176
183
  </details>
177
184
 
178
- # Language modes
185
+ ## Language modes
186
+
187
+ ### abusefilter
188
+
189
+ *version added: 3.10.0*
190
+
191
+ <details>
192
+ <summary>Expand</summary>
193
+
194
+ You can bundle the [AbuseFilter](https://www.mediawiki.org/wiki/Extension:AbuseFilter) mode by importing the `registerAbuseFilter` function:
195
+
196
+ ```js
197
+ import {registerAbuseFilter} from '@bhsd/codemirror-mediawiki';
198
+ registerAbuseFilter();
199
+ ```
200
+
201
+ If you want a more granular control over the extensions, you can import the `registerAbuseFilterCore` function and the desired extensions:
202
+
203
+ ```js
204
+ import {registerAbuseFilterCore} from '@bhsd/codemirror-mediawiki';
205
+ registerAbuseFilterCore();
206
+ ```
207
+
208
+ </details>
179
209
 
180
- ## css
210
+ ### css
181
211
 
182
212
  <details>
183
213
  <summary>Expand</summary>
@@ -205,7 +235,7 @@ registerColorPickerForCSS();
205
235
 
206
236
  </details>
207
237
 
208
- ## html
238
+ ### html
209
239
 
210
240
  <details>
211
241
  <summary>Expand</summary>
@@ -228,16 +258,18 @@ In addition to the common [extensions](#extensions), here are some HTML-specific
228
258
 
229
259
  ```js
230
260
  import {
261
+ registerBracketMatchingForHTML,
231
262
  registerCloseBracketsForHTML,
232
263
  registerColorPickerForHTML,
233
264
  } from '@bhsd/codemirror-mediawiki';
265
+ registerBracketMatchingForHTML();
234
266
  registerCloseBracketsForHTML();
235
267
  registerColorPickerForHTML();
236
268
  ```
237
269
 
238
270
  </details>
239
271
 
240
- ## javascript
272
+ ### javascript
241
273
 
242
274
  <details>
243
275
  <summary>Expand</summary>
@@ -258,7 +290,7 @@ registerJavaScriptCore();
258
290
 
259
291
  </details>
260
292
 
261
- ## json
293
+ ### json
262
294
 
263
295
  <details>
264
296
  <summary>Expand</summary>
@@ -279,7 +311,7 @@ registerJSONCore();
279
311
 
280
312
  </details>
281
313
 
282
- ## lua
314
+ ### lua
283
315
 
284
316
  <details>
285
317
  <summary>Expand</summary>
@@ -300,7 +332,7 @@ registerLuaCore();
300
332
 
301
333
  </details>
302
334
 
303
- ## mediawiki
335
+ ### mediawiki
304
336
 
305
337
  <details>
306
338
  <summary>Expand</summary>
@@ -309,7 +341,8 @@ You can bundle the MediaWiki mode by importing the `registerMediaWiki` function:
309
341
 
310
342
  ```js
311
343
  import {registerMediaWiki} from '@bhsd/codemirror-mediawiki';
312
- registerMediaWiki();
344
+ // optionally pass the article path of a MediaWiki site
345
+ registerMediaWiki('https://www.mediawiki.org/wiki/');
313
346
  ```
314
347
 
315
348
  The MediaWiki mode provides the following key bindings for quick formatting:
@@ -333,7 +366,8 @@ If you want a more granular control over the extensions, you can import the `reg
333
366
 
334
367
  ```js
335
368
  import {registerMediaWikiCore} from '@bhsd/codemirror-mediawiki';
336
- registerMediaWikiCore();
369
+ // optionally pass the article path of a MediaWiki site
370
+ registerMediaWikiCore('https://www.mediawiki.org/wiki/');
337
371
  ```
338
372
 
339
373
  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:
@@ -351,7 +385,7 @@ registerCodeFoldingForMediaWiki();
351
385
 
352
386
  </details>
353
387
 
354
- ## vue
388
+ ### vue
355
389
 
356
390
  <details>
357
391
  <summary>Expand</summary>
@@ -383,7 +417,7 @@ registerColorPickerForVue();
383
417
 
384
418
  </details>
385
419
 
386
- ## Other languages
420
+ ### Other languages
387
421
 
388
422
  <details>
389
423
  <summary>Expand</summary>
@@ -406,13 +440,13 @@ registerLanguageCore('python', python);
406
440
 
407
441
  </details>
408
442
 
409
- # Themes
443
+ ## Themes
410
444
 
411
- ## light
445
+ ### light
412
446
 
413
447
  This is the default theme, which is a light theme.
414
448
 
415
- ## nord
449
+ ### nord
416
450
 
417
451
  <details>
418
452
  <summary>Expand</summary>
@@ -426,7 +460,7 @@ registerTheme('nord', nord);
426
460
 
427
461
  </details>
428
462
 
429
- ## Other themes
463
+ ### Other themes
430
464
 
431
465
  <details>
432
466
  <summary>Expand</summary>
@@ -441,14 +475,14 @@ registerTheme('one-dark', oneDark);
441
475
 
442
476
  </details>
443
477
 
444
- # Constructor
478
+ ## Constructor
445
479
 
446
480
  <details>
447
481
  <summary>Expand</summary>
448
482
 
449
483
  **param**: `HTMLTextAreaElement` the textarea element to be replaced by CodeMirror
450
484
  **param**: `string` the language mode to be used, default as plain text
451
- **param**: `unknown` the language configuration, only required for the MediaWiki mode and the mixed MediaWiki-HTML mode
485
+ **param**: `unknown` the language configuration, only required for the [MediaWiki](#mediawiki) mode and the [mixed MediaWiki-HTML](#html) mode
452
486
  **param**: `boolean` whether to initialize immediately, default as true
453
487
 
454
488
  ```js
@@ -461,13 +495,14 @@ cm = new CodeMirror6(textarea, 'javascript');
461
495
  cm = new CodeMirror6(textarea, 'json');
462
496
  cm = new CodeMirror6(textarea, 'lua');
463
497
  cm = new CodeMirror6(textarea, 'vue');
498
+ cm = new CodeMirror6(textarea, 'abusefilter', dialect);
464
499
  ```
465
500
 
466
501
  </details>
467
502
 
468
- # Accessors
503
+ ## Accessors
469
504
 
470
- ## dialect
505
+ ### dialect
471
506
 
472
507
  <details>
473
508
  <summary>Expand</summary>
@@ -479,7 +514,7 @@ Only used for [Extension:TemplateStyles](https://www.mediawiki.org/wiki/Extensio
479
514
 
480
515
  </details>
481
516
 
482
- ## lang
517
+ ### lang
483
518
 
484
519
  <details>
485
520
  <summary>Expand</summary>
@@ -491,7 +526,7 @@ The current language mode, read-only.
491
526
 
492
527
  </details>
493
528
 
494
- ## textarea
529
+ ### textarea
495
530
 
496
531
  <details>
497
532
  <summary>Expand</summary>
@@ -501,7 +536,7 @@ The textarea element replaced by CodeMirror, read-only.
501
536
 
502
537
  </details>
503
538
 
504
- ## view
539
+ ### view
505
540
 
506
541
  <details>
507
542
  <summary>Expand</summary>
@@ -511,7 +546,7 @@ The CodeMirror EditorView instance, read-only.
511
546
 
512
547
  </details>
513
548
 
514
- ## visible
549
+ ### visible
515
550
 
516
551
  <details>
517
552
  <summary>Expand</summary>
@@ -523,9 +558,9 @@ Whether the editor is visible, read-only.
523
558
 
524
559
  </details>
525
560
 
526
- # Methods
561
+ ## Methods
527
562
 
528
- ## destroy
563
+ ### destroy
529
564
 
530
565
  <details>
531
566
  <summary>Expand</summary>
@@ -540,7 +575,7 @@ cm.destroy();
540
575
 
541
576
  </details>
542
577
 
543
- ## extraKeys
578
+ ### extraKeys
544
579
 
545
580
  <details>
546
581
  <summary>Expand</summary>
@@ -558,7 +593,7 @@ cm.extraKeys([
558
593
 
559
594
  </details>
560
595
 
561
- ## getLinter
596
+ ### getLinter
562
597
 
563
598
  <details>
564
599
  <summary>Expand</summary>
@@ -578,7 +613,7 @@ const linterCSS = await cm.getLinter({rules}); // Stylelint configuration
578
613
 
579
614
  </details>
580
615
 
581
- ## getNodeAt
616
+ ### getNodeAt
582
617
 
583
618
  <details>
584
619
  <summary>Expand</summary>
@@ -595,7 +630,7 @@ const tree = cm.getNodeAt(0);
595
630
 
596
631
  </details>
597
632
 
598
- ## hasPreference
633
+ ### hasPreference
599
634
 
600
635
  <details>
601
636
  <summary>Expand</summary>
@@ -612,7 +647,7 @@ const hasAutocompletion = cm.hasPreference('autocompletion');
612
647
 
613
648
  </details>
614
649
 
615
- ## initialize
650
+ ### initialize
616
651
 
617
652
  <details>
618
653
  <summary>Expand</summary>
@@ -628,7 +663,7 @@ cm.initialize();
628
663
 
629
664
  </details>
630
665
 
631
- ## lint
666
+ ### lint
632
667
 
633
668
  <details>
634
669
  <summary>Expand</summary>
@@ -653,7 +688,7 @@ cm.lint(({doc}) => [
653
688
 
654
689
  </details>
655
690
 
656
- ## localize
691
+ ### localize
657
692
 
658
693
  <details>
659
694
  <summary>Expand</summary>
@@ -671,7 +706,7 @@ cm.localize({
671
706
 
672
707
  </details>
673
708
 
674
- ## prefer
709
+ ### prefer
675
710
 
676
711
  <details>
677
712
  <summary>Expand</summary>
@@ -734,7 +769,7 @@ cm.prefer({
734
769
 
735
770
  </details>
736
771
 
737
- ## replaceSelections
772
+ ### replaceSelections
738
773
 
739
774
  <details>
740
775
  <summary>Expand</summary>
@@ -750,7 +785,7 @@ cm.replaceSelections(str => str.toUpperCase());
750
785
 
751
786
  </details>
752
787
 
753
- ## scrollTo
788
+ ### scrollTo
754
789
 
755
790
  <details>
756
791
  <summary>Expand</summary>
@@ -766,7 +801,7 @@ cm.scrollTo();
766
801
 
767
802
  </details>
768
803
 
769
- ## setContent
804
+ ### setContent
770
805
 
771
806
  <details>
772
807
  <summary>Expand</summary>
@@ -783,7 +818,7 @@ cm.setContent('');
783
818
 
784
819
  </details>
785
820
 
786
- ## setIndent
821
+ ### setIndent
787
822
 
788
823
  <details>
789
824
  <summary>Expand</summary>
@@ -800,13 +835,13 @@ cm.setIndent('\t');
800
835
 
801
836
  </details>
802
837
 
803
- ## setLanguage
838
+ ### setLanguage
804
839
 
805
840
  <details>
806
841
  <summary>Expand</summary>
807
842
 
808
843
  **param**: `string` the language mode to be used, default as plain text
809
- **param**: `unknown` the optional language configuration
844
+ **param**: `unknown` the language configuration, only required for the [MediaWiki](#mediawiki) mode and the [mixed MediaWiki-HTML](#html) mode
810
845
  Set the language mode.
811
846
 
812
847
  ```js
@@ -817,11 +852,12 @@ cm.setLanguage('javascript');
817
852
  cm.setLanguage('json');
818
853
  cm.setLanguage('lua');
819
854
  cm.setLanguage('vue');
855
+ cm.setLanguage('abusefilter', dialect);
820
856
  ```
821
857
 
822
858
  </details>
823
859
 
824
- ## setLineWrapping
860
+ ### setLineWrapping
825
861
 
826
862
  <details>
827
863
  <summary>Expand</summary>
@@ -838,7 +874,7 @@ cm.setLineWrapping(true);
838
874
 
839
875
  </details>
840
876
 
841
- ## setTheme
877
+ ### setTheme
842
878
 
843
879
  <details>
844
880
  <summary>Expand</summary>
@@ -856,7 +892,7 @@ cm.setTheme('nord');
856
892
 
857
893
  </details>
858
894
 
859
- ## toggle
895
+ ### toggle
860
896
 
861
897
  <details>
862
898
  <summary>Expand</summary>
@@ -874,7 +910,7 @@ cm.toggle(false); // hide CodeMirror
874
910
 
875
911
  </details>
876
912
 
877
- ## update
913
+ ### update
878
914
 
879
915
  <details>
880
916
  <summary>Expand</summary>
@@ -883,9 +919,9 @@ Refresh linting immediately.
883
919
 
884
920
  </details>
885
921
 
886
- # Static accessors
922
+ ## Static accessors
887
923
 
888
- ## CDN
924
+ ### CDN
889
925
 
890
926
  <details>
891
927
  <summary>Expand</summary>
@@ -901,9 +937,9 @@ CodeMirror6.CDN = 'https://cdn.jsdelivr.net';
901
937
 
902
938
  </details>
903
939
 
904
- # Static methods
940
+ ## Static methods
905
941
 
906
- ## getMwConfig
942
+ ### getMwConfig
907
943
 
908
944
  <details>
909
945
  <summary>Expand</summary>
@@ -920,7 +956,7 @@ const mwConfig = CodeMirror6.getMwConfig(config);
920
956
 
921
957
  </details>
922
958
 
923
- ## replaceSelections (static)
959
+ ### replaceSelections (static)
924
960
 
925
961
  <details>
926
962
  <summary>Expand</summary>
@@ -937,9 +973,9 @@ CodeMirror6.replaceSelections(cm.view, str => str.toUpperCase());
937
973
 
938
974
  </details>
939
975
 
940
- # Extensions
976
+ ## Extensions
941
977
 
942
- ## allowMultipleSelections
978
+ ### allowMultipleSelections
943
979
 
944
980
  <details>
945
981
  <summary>Expand</summary>
@@ -957,14 +993,14 @@ registerAllowMultipleSelections();
957
993
 
958
994
  </details>
959
995
 
960
- ## autocompletion
996
+ ### autocompletion
961
997
 
962
998
  <details>
963
999
  <summary>Expand</summary>
964
1000
 
965
1001
  *version added: 2.5.1*
966
1002
 
967
- Provide autocompletion for MediaWiki, CSS and JavaScript modes.
1003
+ Provide autocompletion.
968
1004
 
969
1005
  Key bindings:
970
1006
 
@@ -980,7 +1016,25 @@ registerAutocompletion();
980
1016
 
981
1017
  </details>
982
1018
 
983
- ## bracketMatching
1019
+ ### bidiIsolates
1020
+
1021
+ <details>
1022
+ <summary>Expand</summary>
1023
+
1024
+ *version added: 3.10.0*
1025
+
1026
+ When Wikitext contains right-to-left text, isolate bidirectional text from the surrounding text.
1027
+
1028
+ This extension is not included in the [`mediawiki`](#mediawiki) language support by default. You need to import the `registerBidiIsolates` function:
1029
+
1030
+ ```js
1031
+ import {registerBidiIsolates} from '@bhsd/codemirror-mediawiki';
1032
+ registerBidiIsolates();
1033
+ ```
1034
+
1035
+ </details>
1036
+
1037
+ ### bracketMatching
984
1038
 
985
1039
  <details>
986
1040
  <summary>Expand</summary>
@@ -998,7 +1052,7 @@ registerBracketMatching();
998
1052
 
999
1053
  </details>
1000
1054
 
1001
- ## closeBrackets
1055
+ ### closeBrackets
1002
1056
 
1003
1057
  <details>
1004
1058
  <summary>Expand</summary>
@@ -1016,7 +1070,7 @@ registerCloseBrackets();
1016
1070
 
1017
1071
  </details>
1018
1072
 
1019
- ## codeFolding
1073
+ ### codeFolding
1020
1074
 
1021
1075
  <details>
1022
1076
  <summary>Expand</summary>
@@ -1042,7 +1096,7 @@ registerCodeFolding();
1042
1096
 
1043
1097
  </details>
1044
1098
 
1045
- ## colorPicker
1099
+ ### colorPicker
1046
1100
 
1047
1101
  <details>
1048
1102
  <summary>Expand</summary>
@@ -1060,7 +1114,7 @@ registerColorPicker();
1060
1114
 
1061
1115
  </details>
1062
1116
 
1063
- ## escape
1117
+ ### escape
1064
1118
 
1065
1119
  <details>
1066
1120
  <summary>Expand</summary>
@@ -1077,12 +1131,13 @@ For granular control over the bundled extensions, you can import the `registerEs
1077
1131
 
1078
1132
  ```js
1079
1133
  import {registerEscape} from '@bhsd/codemirror-mediawiki';
1080
- registerEscape();
1134
+ // optionally pass the article path of a MediaWiki site
1135
+ registerEscape('https://www.mediawiki.org/wiki/');
1081
1136
  ```
1082
1137
 
1083
1138
  </details>
1084
1139
 
1085
- ## highlightActiveLine
1140
+ ### highlightActiveLine
1086
1141
 
1087
1142
  <details>
1088
1143
  <summary>Expand</summary>
@@ -1098,7 +1153,7 @@ registerHighlightActiveLine();
1098
1153
 
1099
1154
  </details>
1100
1155
 
1101
- ## highlightSelectionMatches
1156
+ ### highlightSelectionMatches
1102
1157
 
1103
1158
  <details>
1104
1159
  <summary>Expand</summary>
@@ -1116,7 +1171,7 @@ registerHighlightSelectionMatches();
1116
1171
 
1117
1172
  </details>
1118
1173
 
1119
- ## highlightSpecialChars
1174
+ ### highlightSpecialChars
1120
1175
 
1121
1176
  <details>
1122
1177
  <summary>Expand</summary>
@@ -1132,7 +1187,7 @@ registerHighlightSpecialChars();
1132
1187
 
1133
1188
  </details>
1134
1189
 
1135
- ## highlightTrailingWhitespace
1190
+ ### highlightTrailingWhitespace
1136
1191
 
1137
1192
  <details>
1138
1193
  <summary>Expand</summary>
@@ -1150,7 +1205,7 @@ registerHighlightTrailingWhitespace();
1150
1205
 
1151
1206
  </details>
1152
1207
 
1153
- ## highlightWhitespace
1208
+ ### highlightWhitespace
1154
1209
 
1155
1210
  <details>
1156
1211
  <summary>Expand</summary>
@@ -1168,7 +1223,7 @@ registerHighlightWhitespace();
1168
1223
 
1169
1224
  </details>
1170
1225
 
1171
- ## hover
1226
+ ### hover
1172
1227
 
1173
1228
  <details>
1174
1229
  <summary>Expand</summary>
@@ -1181,12 +1236,13 @@ For granular control over the bundled extensions, you can import the `registerHo
1181
1236
 
1182
1237
  ```js
1183
1238
  import {registerHover} from '@bhsd/codemirror-mediawiki';
1184
- registerHover();
1239
+ // optionally pass the article path of a MediaWiki site
1240
+ registerHover('https://www.mediawiki.org/wiki/');
1185
1241
  ```
1186
1242
 
1187
1243
  </details>
1188
1244
 
1189
- ## inlayHints
1245
+ ### inlayHints
1190
1246
 
1191
1247
  <details>
1192
1248
  <summary>Expand</summary>
@@ -1199,12 +1255,13 @@ For granular control over the bundled extensions, you can import the `registerIn
1199
1255
 
1200
1256
  ```js
1201
1257
  import {registerInlayHints} from '@bhsd/codemirror-mediawiki';
1202
- registerInlayHints();
1258
+ // optionally pass the article path of a MediaWiki site
1259
+ registerInlayHints('https://www.mediawiki.org/wiki/');
1203
1260
  ```
1204
1261
 
1205
1262
  </details>
1206
1263
 
1207
- ## openLinks
1264
+ ### openLinks
1208
1265
 
1209
1266
  <details>
1210
1267
  <summary>Expand</summary>
@@ -1217,12 +1274,13 @@ For granular control over the bundled extensions, you can import the `registerOp
1217
1274
 
1218
1275
  ```js
1219
1276
  import {registerOpenLinks} from '@bhsd/codemirror-mediawiki';
1220
- registerOpenLinks();
1277
+ // optionally pass the article path of a MediaWiki site
1278
+ registerOpenLinks('https://www.mediawiki.org/wiki/');
1221
1279
  ```
1222
1280
 
1223
1281
  </details>
1224
1282
 
1225
- ## refHover
1283
+ ### refHover
1226
1284
 
1227
1285
  <details>
1228
1286
  <summary>Expand</summary>
@@ -1235,12 +1293,13 @@ For granular control over the bundled extensions, you can import the `registerRe
1235
1293
 
1236
1294
  ```js
1237
1295
  import {registerRefHover} from '@bhsd/codemirror-mediawiki';
1238
- registerRefHover();
1296
+ // optionally pass the article path of a MediaWiki site
1297
+ registerRefHover('https://www.mediawiki.org/wiki/');
1239
1298
  ```
1240
1299
 
1241
1300
  </details>
1242
1301
 
1243
- ## scrollPastEnd
1302
+ ### scrollPastEnd
1244
1303
 
1245
1304
  <details>
1246
1305
  <summary>Expand</summary>
@@ -1258,7 +1317,7 @@ registerScrollPastEnd();
1258
1317
 
1259
1318
  </details>
1260
1319
 
1261
- ## signatureHelp
1320
+ ### signatureHelp
1262
1321
 
1263
1322
  <details>
1264
1323
  <summary>Expand</summary>
@@ -1271,49 +1330,50 @@ For granular control over the bundled extensions, you can import the `registerSi
1271
1330
 
1272
1331
  ```js
1273
1332
  import {registerSignatureHelp} from '@bhsd/codemirror-mediawiki';
1274
- registerSignatureHelp();
1333
+ // optionally pass the article path of a MediaWiki site
1334
+ registerSignatureHelp('https://www.mediawiki.org/wiki/');
1275
1335
  ```
1276
1336
 
1277
1337
  </details>
1278
1338
 
1279
- # Known issues
1339
+ ## Known issues
1280
1340
 
1281
- ## Syntax Highlighting
1341
+ ### Syntax Highlighting
1282
1342
 
1283
1343
  <details>
1284
1344
  <summary>Expand</summary>
1285
1345
 
1286
- ### Extension
1346
+ #### Extension
1287
1347
 
1288
1348
  1. [Extension:Poem](https://www.mediawiki.org/wiki/Extension:Poem) should prevent preformatted text ([Example](http://bhsd-harry.github.io/monaco-wiki/tests.html#%3Cpoem%3E%20with%20leading%20whitespace)).
1289
1349
 
1290
- ### Transclusion
1350
+ #### Transclusion
1291
1351
 
1292
1352
  1. Non-existing parser functions starting with `#` are highlighted as parser functions ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Parsoid%3A%20unknown%20parser%20function%20(T314524))).
1293
1353
  1. Wikitext in template parameter names is not highlighted ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Templates%3A%20Other%20wikitext%20in%20parameter%20names%20(T69657))).
1294
1354
  1. Template parameter names followed by a newline are not recognized ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Templates%3A%20Handle%20comments%20in%20parameter%20names%20(T69657))).
1295
1355
  1. Template-like syntax without a template name ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#T408631%3A%20Invalid%20templates%20inside%20template%20parameters)).
1296
1356
 
1297
- ### Heading
1357
+ #### Heading
1298
1358
 
1299
1359
  1. Comments at the SOL should not break section headings ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Section%20extraction%20prefixed%20by%20comment%20(section%201))).
1300
1360
 
1301
- ### Table
1361
+ #### Table
1302
1362
 
1303
1363
  1. Comments at the SOL should not break table syntax ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#3c.%20Table%20cells%20without%20escapable%20prefixes%20after%20edits)).
1304
1364
  1. `!!` in links should start a new `<th>` ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Precedence%20of%20table%20over%20links)).
1305
1365
 
1306
- ### External link
1366
+ #### External link
1307
1367
 
1308
1368
  1. IPv6 addresses are not supported ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#IPv6%20urls%2C%20autolink%20format%20(T23261))).
1309
1369
  1. External links inside double brackets are highlighted incorrectly ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
1310
1370
 
1311
- ### Block element
1371
+ #### Block element
1312
1372
 
1313
1373
  1. Comments at the SOL break the highlighting ([Example](https://bhsd-harry.github.io/codemirror-mediawiki/tests.html#1.%20Lists%20with%20start-of-line-transparent%20tokens%20before%20bullets%3A%20Comments)).
1314
1374
  1. False positives of preformatted text when there are categories ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Category%20%2F%20paragraph%20interactions)) or HTML tags ([Example](http://bhsd-harry.github.io/codemirror-mediawiki/tests.html#Parsing%20optional%20HTML%20elements%20(T8171))).
1315
1375
 
1316
- ### Language conversion
1376
+ #### Language conversion
1317
1377
 
1318
1378
  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))).
1319
1379