editor.js
editor.js copied to clipboard
Pasting from Google Docs Strips Basic Text Formatting (Bold, Italic, Underline)
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
- Create a document in Google Docs.
- Apply bold, italic, and underline formatting to some text.
- Copy the formatted text from Google Docs.
- Paste the text into an Editor.js editor.
Expected behavior
The pasted text should retain the bold, italic, and underline formatting.
Screenshots
@gohabereg can help with this one please ?
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