Skip to content
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

Block-Editor: Enable pasting HTML (from Google Doc and RichText) #20262

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

AndreasFaust
Copy link

@AndreasFaust AndreasFaust commented May 3, 2024

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):

  1. We added the package slate-hyperscript.
  2. We typed the code from the example (which was quite a challenge).
  3. We optimized the example to be able to handle text from Google Docs correctly.

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?

  1. Create a Google Doc or RichText document.
  2. Create Headlines, Paragraphs, Lists
  3. Add links
  4. Add some formatting (bold, italic, underline)
  5. Copy the document to a Block Editor field

Related issue(s)/PR(s)

Fixes issue #19051

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 5:00pm

@strapi-cla
Copy link

strapi-cla commented May 3, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants