editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Pasting from Google Docs Strips Basic Text Formatting (Bold, Italic, Underline)

Open orbachar opened this issue 11 months ago • 2 comments

When pasting text from Google Docs into an Editor.js editor, basic text formatting like bold, italic, and underline is not preserved. The text is pasted as plain text, losing all formatting.

To Reproduce

  1. Create a document in Google Docs.
  2. Apply bold, italic, and underline formatting to some text.
  3. Copy the formatted text from Google Docs.
  4. Paste the text into an Editor.js editor.

Expected behavior

The pasted text should retain the bold, italic, and underline formatting.

Screenshots

Image

orbachar avatar Feb 10 '25 17:02 orbachar

@gohabereg can help with this one please ?

virgo-fondasys avatar Oct 02 '25 06:10 virgo-fondasys

I came up with this solution:

Inherit from paragraph and create your own PrettyParagraph class, handling Google's formatting separately

example: https://gist.github.com/SunnyCapt/5c7da2c7f8a020c758b53a304c8cb41d

It works fine, I hope it helps you too

SunnyCapt avatar Oct 14 '25 15:10 SunnyCapt