editor-js / list

Advanced List tool for the Editor.js.
MIT License
48 stars 47 forks source link

Support multiple pasting formats #63

Open astrocket opened 11 months ago

astrocket commented 11 months ago

Current version of nested-list can render Case 2 style only.

This PR refactors pasteHandler to support Case 1, Case 2 and Mix of each cases.

Pasted Case 1.

<ul>
<li>editor</li>
<ul>
<li>nested-list</li>
</ul>
</ul>

Pasted Case 2

<ul>
<li>
editor
<ul>
<li>nested-list</li>
</ul>
</li>
</ul>
bettysteger commented 11 months ago

Case 2 is the correct HTML structure, see https://stackoverflow.com/a/5899394/595152

astrocket commented 10 months ago

@bettysteger I agree, but it is used in real world and users have been pasting that format so I thought it would be nice to support both.

skovy commented 7 months ago

This occurs when pasting from Notes on macOS. Would be great to support both ways! (and maybe always output as the valid HTML structure?)

Edit: commented with a patch on https://github.com/editor-js/nested-list/pull/65#issuecomment-2025517773 that solved this problem and the one in that PR for me.

CodyPChristian commented 7 months ago

@skovy @astrocket Any updates on this being merged?

astrocket commented 6 months ago

@neSpecc Can this be merged? or any comment?