@bhsd/codemirror-mediawiki 2.4.2 → 2.4.4
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 +79 -1
- package/dist/codemirror.d.ts +1 -1
- package/dist/main.min.js +1 -1
- package/dist/mw.min.js +1 -1
- package/dist/mw.min.js.map +4 -4
- package/i18n/en.json +4 -2
- package/i18n/zh-hans.json +4 -2
- package/i18n/zh-hant.json +4 -2
- package/mw/base.ts +11 -1
- package/mw/config.ts +4 -3
- package/mw/msg.ts +11 -4
- package/mw/openLinks.ts +11 -11
- package/mw/preference.ts +8 -4
- package/mw/wikiEditor.ts +30 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
- [update](#update)
|
|
27
27
|
- [Static methods](#static-methods)
|
|
28
28
|
- [replaceSelections](#replaceselections)
|
|
29
|
+
- [Extensions](#extensions)
|
|
30
|
+
- [allowMultipleSelections](#allowmultipleselections)
|
|
31
|
+
- [bracketMatching](#bracketmatching)
|
|
32
|
+
- [closeBrackets](#closebrackets)
|
|
33
|
+
- [highlightActiveLine](#highlightactiveline)
|
|
34
|
+
- [highlightSpecialChars](#highlightspecialchars)
|
|
35
|
+
- [highlightWhitespace](#highlightwhitespace)
|
|
36
|
+
- [highlightTrailingWhitespace](#highlighttrailingwhitespace)
|
|
37
|
+
- [escape](#escape)
|
|
38
|
+
- [codeFolding](#codefolding)
|
|
39
|
+
- [tagMatching](#tagmatching)
|
|
29
40
|
|
|
30
41
|
</details>
|
|
31
42
|
|
|
@@ -226,7 +237,7 @@ cm.localize({
|
|
|
226
237
|
*version added: 2.0.9*
|
|
227
238
|
|
|
228
239
|
**param**: `string[] | Record<string, boolean>` the preferred [CodeMirror extensions](https://codemirror.net/docs/extensions/)
|
|
229
|
-
Set the preferred CodeMirror extensions.
|
|
240
|
+
Set the preferred CodeMirror extensions. Available extensions are introduced [later](#extensions).
|
|
230
241
|
|
|
231
242
|
```js
|
|
232
243
|
cm.prefer([
|
|
@@ -359,3 +370,70 @@ CodeMirror6.replaceSelections(cm.view, str => str.toUpperCase());
|
|
|
359
370
|
```
|
|
360
371
|
|
|
361
372
|
</details>
|
|
373
|
+
|
|
374
|
+
# Extensions
|
|
375
|
+
|
|
376
|
+
## allowMultipleSelections
|
|
377
|
+
|
|
378
|
+
*version added: 2.1.11*
|
|
379
|
+
|
|
380
|
+
Allow multiple selections.
|
|
381
|
+
|
|
382
|
+
## bracketMatching
|
|
383
|
+
|
|
384
|
+
*version added: 2.0.9*
|
|
385
|
+
|
|
386
|
+
Matched or unmatched brackets are highlighted in cyan or dark red when the cursor is next to them.
|
|
387
|
+
|
|
388
|
+
## closeBrackets
|
|
389
|
+
|
|
390
|
+
*version added: 2.0.9*
|
|
391
|
+
|
|
392
|
+
Automatically close brackets (`{`, `[` and `(`) and quotes (`"`, and `'` except for the MediaWiki mode).
|
|
393
|
+
|
|
394
|
+
## highlightActiveLine
|
|
395
|
+
|
|
396
|
+
Highlight the line the cursor is on in light cyan.
|
|
397
|
+
|
|
398
|
+
## highlightSpecialChars
|
|
399
|
+
|
|
400
|
+
Show invisible characters as red dots.
|
|
401
|
+
|
|
402
|
+
## highlightWhitespace
|
|
403
|
+
|
|
404
|
+
*version added: 2.0.12*
|
|
405
|
+
|
|
406
|
+
Show spaces and tabs as dots and arrows.
|
|
407
|
+
|
|
408
|
+
## highlightTrailingWhitespace
|
|
409
|
+
|
|
410
|
+
*version added: 2.0.9*
|
|
411
|
+
|
|
412
|
+
Highlight trailing whitespace in a red-orange color.
|
|
413
|
+
|
|
414
|
+
## escape
|
|
415
|
+
|
|
416
|
+
*version added: 2.2.2*
|
|
417
|
+
|
|
418
|
+
Key bindings:
|
|
419
|
+
|
|
420
|
+
- `Ctrl`/`Cmd` + `[`: Escape the selected text with HTML entities
|
|
421
|
+
- `Ctrl`/`Cmd` + `]`: Escape the selected text with URL encoding
|
|
422
|
+
|
|
423
|
+
## codeFolding
|
|
424
|
+
|
|
425
|
+
*version added: 2.3.0*
|
|
426
|
+
|
|
427
|
+
Fold template parameters.
|
|
428
|
+
|
|
429
|
+
Key bindings:
|
|
430
|
+
|
|
431
|
+
- `Ctrl` + `Shift` + `[`/`Cmd` + `Alt` + `[`: Fold the selected templates
|
|
432
|
+
- `Ctrl` + `Shift` + `]`/`Cmd` + `Alt` + `]`: Unfold the selected templates
|
|
433
|
+
- `Ctrl` + `Alt` + `]`: Unfold all templates
|
|
434
|
+
|
|
435
|
+
## tagMatching
|
|
436
|
+
|
|
437
|
+
*version added: 2.4.1*
|
|
438
|
+
|
|
439
|
+
Matched or unmatched tags are highlighted in cyan or dark red when the cursor is inside.
|
package/dist/codemirror.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare class CodeMirror6 {
|
|
|
73
73
|
getNodeAt(position: number): SyntaxNode | undefined;
|
|
74
74
|
/**
|
|
75
75
|
* 替换选中内容
|
|
76
|
-
* @param view
|
|
76
|
+
* @param view
|
|
77
77
|
* @param func 替换函数
|
|
78
78
|
*/
|
|
79
79
|
static replaceSelections(view: EditorView, func: (str: string) => string): void;
|