Skip to content

Commit 3480cba

Browse files
committed
docs: 6.2.1
1 parent 6939f1a commit 3480cba

File tree

4 files changed

+60
-5
lines changed

4 files changed

+60
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"markdown-it-anchor": "^9.2.0",
1919
"markdown-it-link-attributes": "^4.0.1",
2020
"markdown-it-mark": "^4.0.0",
21-
"md-editor-rt": "^6.2.0",
21+
"md-editor-rt": "^6.2.1",
2222
"next": "^15.3.3",
2323
"react": "^19.1.0",
2424
"react-dom": "^19.1.0",

public/api-en-US.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,34 @@ config({
13681368
});
13691369
```
13701370
1371+
Below is the list of built-in extensions:
1372+
1373+
| Name | type | Description | compartment | options type | default options |
1374+
| --- | --- | --- | --- | --- | --- |
1375+
| lineWrapping | `lineWrapping` | Enable the editor's line-wrapping mode (automatically wrap long lines). | none | none | none |
1376+
| keymap | `keymap` | Register default keybindings (including editor commands, undo/redo, indentation with Tab, etc.). | none | none | none |
1377+
| drawSelection | `drawSelection` | Fix cursor rendering or selection drawing issues with multi-line placeholders by using CodeMirror's `drawSelection()`. | none | none | none |
1378+
| markdown | `markdown` | Enable Markdown language support using `@codemirror/lang-markdown` and provide a list of recognized code languages. | none | none | none |
1379+
| linkShortener | `linkShortener` | Link shortener to collapse long links in the editor, created via the `createTextShortener` factory. | none | `TextShortenerOptions` (see below) | `maxLength: 30` |
1380+
| floatingToolbar | `floatingToolbar` | Floating toolbar extension, created via `createFloatingToolbar`. Enabled when `floatingToolbars.length > 0`. | `floatingToolbarComp` | none | none |
1381+
1382+
```ts
1383+
interface FindTextsContext {
1384+
state: EditorState;
1385+
lineText: string;
1386+
lineNumber: number;
1387+
lineFrom: number;
1388+
lineTo: number;
1389+
defaultTextRegex: RegExp;
1390+
}
1391+
1392+
interface TextShortenerOptions {
1393+
maxLength: number;
1394+
shortenText?: (text: string) => string;
1395+
findTexts?: (context: FindTextsContext) => Array<[number, number]>;
1396+
}
1397+
```
1398+
13711399
---
13721400
13731401
### 🍤 markdownItConfig

public/api-zh-CN.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,33 @@ config({
13991399
});
14001400
```
14011401
1402+
以下是内置的扩展列表:
1403+
1404+
| 名称 | type | 描述 | compartment | options 类型 | 默认 options |
1405+
| --- | --- | --- | --- | --- | --- |
1406+
| lineWrapping | `lineWrapping` | 启用编辑器的横向换行模式(当行太长时自动换行显示)。 | 无 | 无 | 无 |
1407+
| keymap | `keymap` | 注册默认快捷键集合(包括编辑器命令、历史撤销/重做、缩进 Tab 等)。 | 无 | 无 | 无 |
1408+
| drawSelection | `drawSelection` | 解决多行 placeholder 时光标渲染或选择绘制的问题,使用 CodeMirror 的 `drawSelection()` 插件来绘制选择区域和光标。 | 无 | 无 | 无 |
1409+
| markdown | `markdown` | 启用 Markdown 语言支持,使用 `@codemirror/lang-markdown` 并传入可识别的代码语言列表(`languages`)。 | 无 | 无 | 无 |
1410+
| linkShortener | `linkShortener` | 链接缩短器,用于在编辑器中对长链接进行短化显示,基于 `createTextShortener` 工厂函数创建扩展。 | 无 | `TextShortenerOptions`,参见下方接口 | `maxLength: 30` |
1411+
| floatingToolbar | `floatingToolbar` | 浮动工具栏扩展,基于 `createFloatingToolbar` 创建。该扩展在 `floatingToolbars.length > 0` 时启用,否则为空数组。 | `floatingToolbarComp` | 无 | 无 |
1412+
1413+
```ts
1414+
interface FindTextsContext {
1415+
state: EditorState;
1416+
lineText: string;
1417+
lineNumber: number;
1418+
lineFrom: number;
1419+
lineTo: number;
1420+
defaultTextRegex: RegExp;
1421+
}
1422+
interface TextShortenerOptions {
1423+
maxLength: number;
1424+
shortenText?: (text: string) => string;
1425+
findTexts?: (context: FindTextsContext) => Array<[number, number]>;
1426+
}
1427+
```
1428+
14021429
---
14031430
14041431
### 🍤 markdownItConfig

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,10 +2524,10 @@ math-intrinsics@^1.1.0:
25242524
resolved "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
25252525
integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==
25262526

2527-
md-editor-rt@^6.2.0:
2528-
version "6.2.0"
2529-
resolved "https://registry.npmjs.org/md-editor-rt/-/md-editor-rt-6.2.0.tgz#39fb19a4a1ae05e3644578f40a5cf416aaea4849"
2530-
integrity sha512-6qZUBj/DjO0jcGA+y3xwRkwdcSI38wAsGdhKYeh9Z/iSUIIrNjDGn7Uhi6ADXicgPo4lKcVuUBRT3HzmHr4+jw==
2527+
md-editor-rt@^6.2.1:
2528+
version "6.2.1"
2529+
resolved "https://registry.npmjs.org/md-editor-rt/-/md-editor-rt-6.2.1.tgz#037d627e83b10d3195fdb667e8d9c7e9fc4bb452"
2530+
integrity sha512-BTQRyMNZJToP5D9YgIDGip9WmBSQQ4P+pbvM2xFu6rojJbDFzie9BDqbNrOSplAKt+dJ9UOPt10tvW3K5+oALg==
25312531
dependencies:
25322532
"@codemirror/autocomplete" "^6.18.7"
25332533
"@codemirror/commands" "^6.8.1"

0 commit comments

Comments
 (0)