Skip to content

fix: preserve text-align on paste from Google Docs#2208

Open
gpardhivvarma wants to merge 1 commit intosuperdoc-dev:mainfrom
gpardhivvarma:fix/preserve-text-align-on-paste-v2
Open

fix: preserve text-align on paste from Google Docs#2208
gpardhivvarma wants to merge 1 commit intosuperdoc-dev:mainfrom
gpardhivvarma:fix/preserve-text-align-on-paste-v2

Conversation

@gpardhivvarma
Copy link
Contributor

Summary

  • Adds CSS text-align inline style fallback in parseAttrs.js so that paragraph alignment (center, right, justify) is preserved when pasting from Google Docs
  • Maps CSS logical values (start/end) to physical OOXML justification values (left/right)
  • Follows the same pattern as the existing spacing/indent CSS fallbacks from PR fix: preserve line spacing and indentation on Google Docs paste #2183

Test plan

  • Added 8 unit tests covering all alignment values, invalid values, and combination with other CSS fallbacks
  • All 717 test files pass (7167 tests)
  • Manual test: paste centered/right-aligned/justified text from Google Docs and verify alignment is preserved

Add CSS text-align fallback in parseAttrs to extract justification
from inline styles (e.g. `<p style="text-align: center">`), following
the same pattern as the existing spacing/indent CSS fallbacks from
PR superdoc-dev#2183. Maps CSS values (left, center, right, justify, start, end)
to OOXML justification values.
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