editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

renderFromHTML not working with nested list

Open thecliffparis opened this issue 1 year ago • 0 comments

Hi,

renderFromHTML duplicates lists content in the editor.

Here is an example to reproduce the error. I hope this helps to fix the bug.

Codepen : https://codepen.io/thecliffparis/pen/mybbwGq

<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script>
...

editor.blocks.renderFromHTML(`<div>  
<ul>
    <li>David 1
      <ul>
        <li>Bulletpoint 1.A</li>
        <li>Bulletpoint 1.B</li>
      </ul>
    </li>
    <li>Erica 2
      <ul>
        <li>Bulletpoint 2.A</li>
        <li>Bulletpoint 2.B</li>
      </ul>
    </li>
  </ul>
</div>`);

Screenshots:

Current display with bug image

Expected display image

Device, Browser, OS: Chrome, Windows 11

Editor.js version: latest

Plugins you use with their versions: list @latest

thecliffparis avatar Dec 02 '24 15:12 thecliffparis