Skip to content

feat(ckeditor): google docs paste, use strong/em not css - #1161

Merged
wesleyboar merged 5 commits into
mainfrom
feat/paste-from-google-docs
May 23, 2026
Merged

feat(ckeditor): google docs paste, use strong/em not css#1161
wesleyboar merged 5 commits into
mainfrom
feat/paste-from-google-docs

Conversation

@wesleyboar

@wesleyboar wesleyboar commented May 22, 2026

Copy link
Copy Markdown
Member

Overview

Allow pasting from Google docs:

  • Fixes paste from Google docs making entire content bold.
  • Replaces <span style="font-weight: 700"> with <strong>.
  • Replaces <span style="font-style: italic"> with <em>.

Caution

Only worked locally. Broke WYSIWYGs on pre-prod and prod (not live) servers. Fixed by #1164.

Related

Changes

  • added pastefromgdocs plugin

Testing & UI

Before

  1. In Google docs, have some formatted text.
  2. Copy from Google docs into Django CMS WYSIWYG editor.
  3. ❌ See all text becomes bold.
Before.mov

Working… Almost

Archived content.
  1. In Google docs, have some formatted text.
  2. Copy from Google docs into Django CMS WYSIWYG editor.
  3. ✅ See only bold text from Google pastes as bold.
  4. ❌ Bold comes from inline style, not <b> nor <strong>.
Current.Status.mov

After

  1. In Google docs, have some formatted text.
  2. Copy from Google docs into Django CMS WYSIWYG editor.
  3. ✅ See only bold text from Google pastes as bold.
  4. ✅ Verify bold comes from <strong>.
After.mov

@wesleyboar wesleyboar changed the title feat(ckeditor): paste from google docs feat(ckeditor): paste from google docs, use strong/em not css May 23, 2026
@wesleyboar wesleyboar changed the title feat(ckeditor): paste from google docs, use strong/em not css feat(ckeditor): google docs paste, use strong/em not css May 23, 2026
@wesleyboar
wesleyboar marked this pull request as ready for review May 23, 2026 01:10
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@wesleyboar
wesleyboar merged commit a888032 into main May 23, 2026
@wesleyboar
wesleyboar deleted the feat/paste-from-google-docs branch May 23, 2026 01:10
wesleyboar added a commit that referenced this pull request May 28, 2026
## Overview

Fixes CKEditor failing to open on remote servers after #1161.

The `pastefromgdocs` plugin registered via `extraPlugins` was returning
404 because `addExternal` (which redirects CKEditor to the CDN) was
placed in the `stylesSet` file. That file loads during editor
initialization, after `extraPlugins` are already resolved — so the
redirect never took effect on prod/pre-prod.

Moving `addExternal` to a dedicated `customConfig` file fixes this:
CKEditor loads `customConfig` first, before plugin resolution.

## Related

- fixes #1161 regression

## Changes

- **added** `ckeditor.config.js` — new CKEditor `customConfig` file;
holds `addExternal` for CDN plugin
- **updated** `djangocms_plugins.py` — register `customConfig`
- **deleted** `addExternal` from `ckeditor.wysiwyg.js` (wrong timing;
now in config file)

## Testing

1. Deploy to pre-prod.
2. Open any page in edit mode and open a text plugin (WYSIWYG).
3. Verify CKEditor opens without console errors about `pastefromgdocs`.
4. Paste content from Google Docs and verify bold/italic paste behavior
still works.

## UI


https://github.com/user-attachments/assets/6359151f-b7d4-419d-a48e-36a076499e8e

---

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant