gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Pasting from Google Docs loses paragraph alignment/indentation

Open ricardo-ramosdotcom opened this issue 5 months ago • 2 comments

Description

Description of the bug

When pasting content from Google Docs into the WordPress editor, headings are detected correctly and inline styles/links (bold, italics) are preserved, but paragraph alignment and indentation are lost.

Expected

  • Preserve headings, inline styles (bold/italic), links, and paragraph alignment and indentation.

Actual

  • ✅ Headings recognized correctly
  • ✅ Bold/Italic preserved
  • ✅ Links preserved
  • ⚠️ Alignment/indentation not preserved (content loses indentation and alignment)

Step-by-step reproduction instructions

Step-by-step reproduction instructions

  1. In Google Docs, create a doc with paragraphs with left/center/right alignment and differing indentation.
  2. Select all → Copy.
  3. Paste into a new post in the WordPress editor (test in both Chrome and Firefox).
  4. Compare formatting fidelity with paragraph alignment/indentation.

Screenshots, screen recording, code snippet

Video: https://cloudup.com/c7YnR9wucFs

Environment info

Environment info

  • WordPress: 6.8.2
  • Theme: Twenty Twenty-Four 1.3
  • Plugins: none
  • OS: macOS Sequoia 15.6
  • Browsers:
    • Chrome 138.0.7204.184 (arm64)
    • Firefox 141.0 (Build ID 20250717180000)
  • Server (FYI): PHP 8.3.24 (FPM), nginx, MariaDB 11.4.7, WP_DEBUG=true

Please confirm that you have searched existing issues in the repo.

  • [x] Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • [x] Yes

Please confirm which theme type you used for testing.

  • [x] Block
  • [ ] Classic
  • [ ] Hybrid (e.g. classic with theme.json)
  • [ ] Not sure

ricardo-ramosdotcom avatar Aug 10 '25 02:08 ricardo-ramosdotcom

I was able to reproduce this issue.

Gutenberg: 21.4.0 Browser: Chrome OS: Mac OS / Windows 11

torounit avatar Aug 19 '25 13:08 torounit

I'm not quite sure if we should do this, the default paste handler is meant to only paste semantic elements and strip all styling (which is often unwanted garbage). Perhaps we could offer some alternative paste preserves all styling such as alignment, colors, padding, etc. but I don't think it belongs in the main paste functionality.

ellatrix avatar Dec 11 '25 15:12 ellatrix