wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

使用editor.insertNode 后,会自动在头部插入一个空段落节点

Open darrenwu opened this issue 2 years ago • 5 comments

bug 描述

使用editor.insertNode 后,会自动在头部插入一个空段落节点

你预期的样子是?

无需自动在头部插入一个空段落节点

系统和浏览器及版本号

  • 操作系统
  • 浏览器和版本

wangEditor 版本

"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",

demo 能否复现该 bug ?

  • 中文 demo https://www.wangeditor.com/demo/
  • English demo https://www.wangeditor.com/demo/?lang=en

在线 demo

https://codesandbox.io/embed/happy-gates-02cl3h?fontsize=14&hidenavigation=1&theme=dark

最小成本的复现步骤

editor初始化后直接inertNode即可 const node = { type: "paragraph", children: [{ text: "simple text" }] }; editor.insertNode(node);

可看在线demo

darrenwu avatar Dec 23 '22 04:12 darrenwu