lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: pasting a table causes a large number of empty lines to be pasted

Open rilrom opened this issue 1 year ago • 6 comments

Lexical version: v0.17.1+dev

Steps To Reproduce

  1. Create a table
  2. Copy table
  3. Paste table

https://github.com/user-attachments/assets/45049ba0-7a1e-404f-8bb1-4fa199b97673

table-copy-paste-1

rilrom avatar Sep 19 '24 04:09 rilrom

I would guess that this has to do with the implementation of $unwrapArtificialNodes

etrepum avatar Sep 19 '24 15:09 etrepum

It looks like this has occured across the majority of previous lexical versions.

Does lexical not currently support the importing of copied html tables? (I'm guessing it's not possible to get the html structure when using copy+paste from a website).

It would be great to look into whether we can at least handle the copy+paste of other lexical tables.

rilrom avatar Sep 21 '24 14:09 rilrom

It really depends on what you mean by support. Does lexical have code that imports tables from html? Yes. Does it work in every possible scenario? No. It's a complicated feature, relatively new, and still has some rough edges. Reporting issues that you've found is helpful, submitting PRs to fix them is even more helpful. I've given you a pointer to where I think the root cause of the bug is likely to be.

etrepum avatar Sep 21 '24 15:09 etrepum

No worries, appreciate the additional context. I'll dive into this and see what I can come up with.

rilrom avatar Sep 21 '24 16:09 rilrom

Hi @etrepum, I couldn't reproduce this bug, is it fixed?

bedre7 avatar Oct 03 '24 07:10 bedre7

Hi @etrepum, I couldn't reproduce this bug, is it fixed?

Still very much reproducible in lexical playground. Unfortunately I haven't had much time or luck in resolving it.

rilrom avatar Oct 03 '24 12:10 rilrom

I can't reproduce this

etrepum avatar Dec 02 '24 01:12 etrepum

You're right, looks like it's been indirectly fixed.

Thanks @etrepum

rilrom avatar Dec 02 '24 02:12 rilrom