-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Raw Handling: Paste from MS Excel no longer creates a table block #42570
Comments
@admturner I have confirmed that this process for Windows, added by #33607, caused the regression. gutenberg/packages/block-editor/src/components/rich-text/use-paste-handler.js Lines 91 to 92 in 92d28ca
Received HTML data differs depending on the presence or absence of this process: With removeWindowsFragments
Without removeWindowsFragments
As the above data shows, data pasted from MS Excel has Since #33607 removes the outside of the fragments, the removal of the table tag would have caused it to no longer match the table schema. |
@admturner, or anyone else, could you please share the HTML that is logged in the console so we can fix and add a test? Example: #46832. No need to provide an example file. Thanks! |
Below are the screencast and recorded logs. I also investigated the cause of this issue in this comment. bcf47031253d3eb4ab3d51c3c112a657.mp4
Testing Environment
|
Yes. Why such HTML is received is discussed in this comment. Even in the gif image seen at the beginning of this issue, you can see that such HTML is recorded in the browser console, so it shouldn't be a problem in my environment. |
Description
Pasting content from Microsoft Excel as a table is not working as expected. I expect to content copied from an Excel spreadsheet to create a table block when pasted in the editor. Instead, it pastes as a paragraph block.
Copying and pasting from Google Sheets works as expected -- it creates a table block in the editor. But copying and pasting from Excel appears to strip the HTML during an intermediary step between pasting and block creation (see screen recording).
This issue appears to have originated in v5.9, but I'm not sure. I used the "WP Downgrade | Specific Core Version" plugin to downgrade from 6.0.1 to 5.8.4 (my end users noticed the issue begin around March or April) and copy-paste from Excel works as expected in 5.8.4.
Step-by-step reproduction instructions
Repeat steps from Google Sheets to see expected behavior.
Screenshots, screen recording, code snippet
On a fresh local WordPress 6.0.1 installation:
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: