@bhsd/codemirror-mediawiki 2.1.5 → 2.1.8
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 +17 -0
- package/dist/codemirror.d.ts +5 -0
- package/dist/main.min.js +12 -12
- package/dist/main.min.js.map +7 -0
- package/mw/dist/base.js +58 -47
- package/package.json +7 -3
- package/src/codemirror.ts +419 -0
- package/src/config.ts +215 -0
- package/src/mediawiki.ts +1301 -0
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- [getLinter](#getlinter)
|
|
15
15
|
- [lint](#lint)
|
|
16
16
|
- [prefer](#prefer)
|
|
17
|
+
- [setContent](#setcontent)
|
|
17
18
|
- [setIndent](#setindent)
|
|
18
19
|
- [setLanguage](#setlanguage)
|
|
19
20
|
- [toggle](#toggle)
|
|
@@ -176,6 +177,22 @@ cm.prefer([
|
|
|
176
177
|
|
|
177
178
|
</details>
|
|
178
179
|
|
|
180
|
+
## setContent
|
|
181
|
+
|
|
182
|
+
<details>
|
|
183
|
+
<summary>Expand</summary>
|
|
184
|
+
|
|
185
|
+
*version added: 2.1.8*
|
|
186
|
+
|
|
187
|
+
**param**: `string` new content
|
|
188
|
+
Reset the content of the editor.
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
cm.setContent('');
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
</details>
|
|
195
|
+
|
|
179
196
|
## setIndent
|
|
180
197
|
|
|
181
198
|
<details>
|
package/dist/codemirror.d.ts
CHANGED
|
@@ -40,6 +40,11 @@ export declare class CodeMirror6 {
|
|
|
40
40
|
setIndent(indent: string): void;
|
|
41
41
|
/** 获取默认linter */
|
|
42
42
|
getLinter(opt?: Record<string, unknown>): Promise<LintSource | undefined>;
|
|
43
|
+
/**
|
|
44
|
+
* 重设编辑器内容
|
|
45
|
+
* @param content 新内容
|
|
46
|
+
*/
|
|
47
|
+
setContent(content: string): void;
|
|
43
48
|
/**
|
|
44
49
|
* 在编辑器和文本框之间切换
|
|
45
50
|
* @param show 是否显示编辑器
|