-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Paste from Word or LibreOffice produces block of CSS first #9719
Comments
Funny thing is, I tested this in Gutenberg v2.0 and it was working fine. |
Regression! I'm calling the unit test police ! I think that it could be handled simply by removing block beginning with a styles statement + comment tag |
Tested and confirmed using LibreOffice 6.0.6.2 and WordPress 4.9.8 and Gutenberg 3.8.0-rc.1 with Firefox 62.0 on macOS 10.13.6. Sample file https://github.com/WordPress/gutenberg/files/2367501/Word.docx Seen at http://alittletestblog.com/wp-admin/post.php?post=14846&action=edit running WordPress 4.9.8 and Gutenberg 3.8.0-rc.1 using Firefox 62.0 on macOS 10.13.6. |
I re-tested to confirm whether this is a regression and I found that the problem does not happen in 3.6.2 but does happen in 3.7. Steps to reproduce:
Result: CSS is included as content in the paste and shows in the visual editor. |
Pasting into Internet Explorer gives a different result, as described in #9759. Styles don't get inserted but all text gets inserted into one block and is not properly formatted (i.e paragraph breaks, lists, etc.). |
Tested and found that using a Classic block allows for proper pasting. No CSS code and it retains formatting. |
It's a bit late here for a proper Git bisecting, but we are indeed missing integration tests for document styling. See #10019 for said tests and a possible fix. |
- Input file for integration test `ms-word-styled` is a truncated version of file provided by issue reporter. See #9719 (comment)
- Input file for integration test `ms-word-styled` is a truncated version of file provided by issue reporter. See #9719 (comment)
* Raw handling: remove <style> tags - Input file for integration test `ms-word-styled` is a truncated version of file provided by issue reporter. See #9719 (comment) * Add Gutenberg integration test
This problem still occurs when you paste inside a block that only allows paragraphs. To reproduce:
|
WordPress 5.8 Pasting text into a page. (I am not certain how to reproduce your testing @pwkip Jules.) Testing with TextMakerFree from Softmaker Free office 2018. Testing with LibreOffice 7.2. |
Thanks for testing Paal. However, you would need to create your own custom group that only allows paragraph blocks before you can reproduce this. Creating your own Gutenberg blocks is still not something trivial as you will need to register the block trough PHP and include some additional JS and CSS files. Explaining how to reproduce the error would mean writing a complete tutorial first. Instead, I'll try to write a quick plugin that registers a group that only allows |
Description
When pasting some simple text (one heading, one paragraph) from Word or LibreOffice, Gutenberg first creates a paragraph block of some CSS text and then the content blocks.
To Reproduce
Expected behavior
One heading block and one paragraph block.
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: