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

Problem with copy/paste from word.

Open bmaisonneuve opened this issue 1 year ago • 2 comments

Hello,

When we copy a nested list form the editor to word it works correctly. But if we copy back the list from word to the editor, the nested element are not working (this can be tester on the demo of editor js).

After some digging, this is because the HTML paste into the editor is incorrect. It looks like this :

<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <ul>
    <li>Black tea</li>
  </ul>
</ul>

Instead of this :

<ul>
  <li>Coffee</li>
  <li>Tea
    <ul>
      <li>Black tea</li>
    </ul>
  </li>
</ul>

The problem is that the sub ul tag is not inside the li tag. For now I discovered the problem only with Word but there might be the problem with other copy paste. I think fixing this might be a good idea to make the copy/paste more resilient.

To fix this we can a code that fixes the HTML before calling the pasteHandler.

I'll make a pull request/

bmaisonneuve avatar Apr 11 '24 15:04 bmaisonneuve

For me (version 2.0.2) the paste from word is not working at all. It generates for every list item a new block.

Sozialarchiv avatar Nov 29 '24 08:11 Sozialarchiv

I was trying to place this text:

Image

Text with bold and italic or italic bold in paragraph. 1) First item list with bold text 2) Second item list with italic text ◦ First not numbered item ◦ Second not numbered item Text after example

Result of paste is this:

Image

Second not numbered item is lost.

fancarpedia avatar Jan 26 '25 00:01 fancarpedia