wangEditor icon indicating copy to clipboard operation
wangEditor copied to clipboard

HTML解析抛出异常 Text node parent is Editor 组件无法运行

Open axolo opened this issue 1 year ago • 2 comments

bug 描述

HTML解析时,抛出异常:Text node parent is Editor,组件无法运行

你预期的样子是?

组件正确解析HTML并正常运行

系统和浏览器及版本号

  • Windows 11 22H2
  • Microsoft Edge 版本 115.0.1901.200 (正式版本) (64 位)

wangEditor 版本

  • @wangeditor/editor@^5.1.23
  • @wangeditor/editor-for-vue@^5.1.12

demo 能否复现该 bug ?

不能

在线 demo

最小成本的复现步骤

<Editor 
  ref="editor" 
  modelValue="<b>测试富文本编辑器</b>" 
/>
Uncaught (in promise) Error: Text node {"text":"测试富文本编辑器","bold":true} parent is Editor
    at index.esm.js:23:54522
    at index.esm.js:23:54759
    at Array.map (<anonymous>)
    at index.esm.js:23:54389
    at UT (index.esm.js:23:55088)
    at index.esm.js:23:55442
    at Array.map (<anonymous>)
    at WT (index.esm.js:23:55417)
    at e10.changeViewState (index.esm.js:23:73810)
    at I_ (index.esm.js:23:96278)

axolo avatar Aug 09 '23 07:08 axolo

在最外层添加p标签即可解决

zhchlmm avatar Apr 02 '24 08:04 zhchlmm