remons-markdown-editor 2.0.0-beta.0 → 2.0.0-beta.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.
@@ -24,9 +24,15 @@ export interface ContainerBlock {
24
24
  endPos: number;
25
25
  /** 类型是否已在注册中心登记(未登记的仅装饰、不可编辑) */
26
26
  registered: boolean;
27
+ /** 容器行首的引用前缀(如 "> ");嵌套在引用中的容器写回时需保留 */
28
+ quotePrefix?: string;
29
+ /** 属性行自身的引用前缀(懒延续时可为空);替换属性行时按它原样保留 */
30
+ propsQuotePrefix?: string;
27
31
  }
28
32
  /**
29
33
  * 在编辑器文档中查找容器块。
30
34
  * 单次遍历 + 预累计行偏移,复杂度 O(行数)。
35
+ * 支持整体嵌套在引用中的容器:头行、属性行、闭合行需具有相同的 "> " 前缀深度,
36
+ * 避免跨引用层级错误配对。闭合 ::: 改为按栈配对,嵌套容器不会被内层闭合误截断。
31
37
  */
32
38
  export declare function findContainers(docText: string): ContainerBlock[];
@@ -10,8 +10,9 @@ export declare function writeContainerProps(props: ContainerProps): string;
10
10
  * 更新编辑器文档中的容器属性。
11
11
  * 已有属性行则整行替换;没有属性行则在容器头行后插入一行。
12
12
  * @param headerPos 容器头行(:::type)任意位置,用于无属性行时定位插入点
13
+ * @param quotePrefix 容器所处的引用前缀(如 "> "),嵌套在引用中时插入的属性行需保持一致
13
14
  */
14
- export declare function updateContainerProps(view: EditorView, headerPos: number, propsLineFrom: number, propsLineTo: number, newProps: ContainerProps): void;
15
+ export declare function updateContainerProps(view: EditorView, headerPos: number, propsLineFrom: number, propsLineTo: number, newProps: ContainerProps, quotePrefix?: string): void;
15
16
  /**
16
17
  * 在当前光标位置插入新容器。
17
18
  * 创建 :::type 打开行 + 属性行 + ::: 关闭行的结构。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remons-markdown-editor",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "type": "module",
5
5
  "description": "一个可复用的 React Markdown 编辑器组件,支持工具栏、预览和自定义容器",
6
6
  "main": "dist/index.cjs",
@@ -49,8 +49,8 @@
49
49
  "codemirror": "^6.0.1",
50
50
  "highlight.js": "^11.12.0",
51
51
  "json5": "^2.2.3",
52
- "remons-markdown-plugins": "^2.0.0-beta.1",
53
- "remons-render-markdown": "^2.0.1-beta.5"
52
+ "remons-markdown-plugins": "^2.0.0-beta.2",
53
+ "remons-render-markdown": "^2.0.1-beta.6"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "antd": ">=5.21.6",