@bhsd/codemirror-mediawiki 2.7.4 → 2.7.6
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 +1 -1
- package/dist/codemirror.d.ts +2 -1
- package/dist/main.min.js +10 -10
- package/dist/mediawiki.d.ts +1 -0
- package/dist/mw.min.js +7 -1
- package/dist/mw.min.js.map +3 -3
- package/i18n/en.json +3 -3
- package/i18n/zh-hans.json +3 -3
- package/i18n/zh-hant.json +3 -3
- package/mw/base.ts +4 -3
- package/mw/config.ts +1 -0
- package/mw/msg.ts +1 -1
- package/mw/openLinks.ts +13 -5
- package/mw/preference.ts +15 -3
- package/mw/textSelection.ts +70 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -411,7 +411,7 @@ const mwConfig = CodeMirror6.getMwConfig(config);
|
|
|
411
411
|
*version added: 2.2.2*
|
|
412
412
|
|
|
413
413
|
**param**: [`EditorView`](https://codemirror.net/6/docs/ref/#view.EditorView) the CodeMirror EditorView instance
|
|
414
|
-
**param**: `(str: string) => string` the replacement function
|
|
414
|
+
**param**: `(str: string, range: {from: number, to: number}) => string | [string, number, number?]` the replacement function
|
|
415
415
|
Replace the selected text with the return value of the replacement function.
|
|
416
416
|
|
|
417
417
|
```js
|
package/dist/codemirror.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { SyntaxNode } from '@lezer/common';
|
|
|
5
5
|
import type { Diagnostic } from '@codemirror/lint';
|
|
6
6
|
import type { Config } from 'wikiparser-node';
|
|
7
7
|
import type { MwConfig } from './mediawiki';
|
|
8
|
+
import type { DocRange } from './fold';
|
|
8
9
|
export type { MwConfig };
|
|
9
10
|
export type LintSource = (doc: Text) => Diagnostic[] | Promise<Diagnostic[]>;
|
|
10
11
|
export declare const CDN = "https://testingcf.jsdelivr.net";
|
|
@@ -105,7 +106,7 @@ export declare class CodeMirror6 {
|
|
|
105
106
|
* @param view
|
|
106
107
|
* @param func 替换函数
|
|
107
108
|
*/
|
|
108
|
-
static replaceSelections(view: EditorView, func: (str: string) => string): void;
|
|
109
|
+
static replaceSelections(view: EditorView, func: (str: string, range: DocRange) => string | [string, number, number?]): void;
|
|
109
110
|
/**
|
|
110
111
|
* 将wikiparser-node设置转换为codemirror-mediawiki设置
|
|
111
112
|
* @param config
|