Block-Editor: Enable pasting HTML (from Google Doc and RichText) #20262
+179
−35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
Until now, links and formatting (like bold, italic or underlined) in pasted text from Google Docs and RichText documents were not retained.
We implemented and improved the code from Slate’s PasteHTML example (https://www.slatejs.org/examples/paste-html):
Why is it needed?
Google Docs and RichText are widely used text editors. Pasting text from these is part of the daily work of many content editors and would be a great quality of life improvement.
We use Strapi for different magazine websites. Magazine editors often copy texts from Google Doc or RichText documents. Switching from our custom
Editor.js
-plugin to the new Slate-based Block Editor made this temporarily impossible.How to test it?
Related issue(s)/PR(s)
Fixes issue #19051