-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tables): Add missing paragraph node when copying empty cells from external resources #5670
fix(tables): Add missing paragraph node when copying empty cells from external resources #5670
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi! Do you think this can be covered with test? |
9aee91d
to
8df05d3
Compare
hey @StyleT , I implemented a test for my fix. As table nodes are not massively covered, I added a bunch of tests for rows and cells too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. However, the paragraph will be automatically created upon typing, which resembles the same behavior as when you type on an empty editor (only a RootNode). Do you mind expanding on the problem you're trying to solve here?
@zurfyx unfortunately no, the paragraph node is not created upon typing in an empty cell 😕 It creates a text node, not a paragraph node: The issue is when you focus an empty table cell node and that you press "Enter". There are some methods involved in Also, I noticed that a paragraph node was explicitely created in cells in methods like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is reasonable. Will let @zurfyx confirm that he doesn't have further objections.
Ouch, you're right, I remember this working in the past... |
thx 🙌 |
Fixes #5662
Issue
When copy/pasting a table from external sources (google doc, google spreadshet, e.g.), an empty cell is created with no child node :
Change
Return
after
callback inconvertTableCellNodeElement
to insert paragraph if the cell is empty :