nested-list icon indicating copy to clipboard operation
nested-list copied to clipboard

Support multiple pasting formats

Open astrocket opened this issue 1 year ago • 5 comments

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>

astrocket avatar Nov 30 '23 13:11 astrocket

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

bettysteger avatar Dec 06 '23 14:12 bettysteger

@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.

astrocket avatar Jan 05 '24 09:01 astrocket

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.

skovy avatar Mar 26 '24 20:03 skovy

@skovy @astrocket Any updates on this being merged?

CodyPChristian avatar Mar 29 '24 04:03 CodyPChristian

@neSpecc Can this be merged? or any comment?

astrocket avatar Apr 27 '24 08:04 astrocket