Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixed text formats being lost when copy/pasting from Google Docs #1055

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

kevinansfield
Copy link
Contributor

@kevinansfield kevinansfield commented Nov 7, 2023

closes https://github.com/TryGhost/Product/issues/4104

When we added support for parsing Word formatting we used node.toggleFormat() but that lead to an issue with Google Docs because the default conversions ran first and set appropriate formats which we were then toggling back off when Google Docs and Word shared similar styling.

  • added checks in our patched conversions to ensure text doesn't already have the appropriate format applied before toggling

closes TryGhost/Product#4104

When we added support for parsing Word formatting we used `node.toggleFormat()` but that lead to an issue with Google Docs because the default conversions ran first and set appropriate formats which we were then toggling back off when Google Docs and Word shared similar styling.

- added checks in our patched conversions to ensure text doesn't already have the appropriate format applied before toggling
@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (0c01756) 92.23% compared to head (b1172af) 92.23%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1055   +/-   ##
=======================================
  Coverage   92.23%   92.23%           
=======================================
  Files         171      171           
  Lines       16102    16102           
  Branches     1468     1468           
=======================================
  Hits        14852    14852           
  Misses       1242     1242           
  Partials        8        8           
Files Coverage Δ
...ges/kg-default-nodes/lib/nodes/ExtendedTextNode.js 25.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kevinansfield kevinansfield merged commit 1fb146c into TryGhost:main Nov 7, 2023
2 checks passed
@kevinansfield kevinansfield deleted the fix-google-docs-formats branch November 7, 2023 15:34
kevinansfield added a commit to kevinansfield/Ghost that referenced this pull request Nov 9, 2023
refs TryGhost#18752
refs TryGhost/Product#3897
refs TryGhost/Product#4112
refs TryGhost/Product#3802
refs TryGhost/Product#4104
refs TryGhost#18866
refs TryGhost#18753
refs TryGhost/Product#4116
refs TryGhost#18888
refs TryGhost#18844

- 🐛 Fixed browser focus on editor when clicking card (TryGhost/Koenig#1051)
- 🐛 Fixed signup card styles with image background (TryGhost/Koenig#1052)
 (TryGhost/Koenig#1053)
- 🐛 Fixed slash menu having fixed position when scrolling (TryGhost/Koenig#1054)
- 🐛 Fixed signup card text color with transparent background (TryGhost/Koenig#1053)
- 🐛 Fixed text formats being lost when copy/pasting from Google Docs (TryGhost/Koenig#1055)
- 🐛 Fixed pasting link behaviour in single line nested editors (TryGhost/Koenig#1056)
- 🐛 Fixed backspace behaviour at start of aside/quote (TryGhost/Koenig#1057)
- 🐛 Fixed text having unexpected formats when rendering (TryGhost/Koenig#1058)
- 🐛 Fixed placeholder descenders being cut off in nested editor (TryGhost/Koenig#1059)
- 🐛 Fixed HTML->Lexical conversion not handling paragraphs inside blockquotes (TryGhost/Koenig#1061)
kevinansfield added a commit to TryGhost/Ghost that referenced this pull request Nov 9, 2023
refs #18752, TryGhost/Product#3897, TryGhost/Product#4112, TryGhost/Product#4104, #18866, #18753, TryGhost/Product#4116, #18888, #18844

- 🐛 Fixed browser focus on editor when clicking card ([Koenig/#1051](TryGhost/Koenig#1051))
- 🐛 Fixed signup card styles with image background ([Koenig/#1052](TryGhost/Koenig#1052))
- 🐛 Fixed slash menu having fixed position when scrolling ([Koenig/#1054](TryGhost/Koenig#1054))
- 🐛 Fixed signup card text color with transparent background ([Koenig/#1053](TryGhost/Koenig#1053))
- 🐛 Fixed text formats being lost when copy/pasting from Google Docs ([Koenig/#1055](TryGhost/Koenig#1055))
- 🐛 Fixed pasting link behaviour in single line nested editors ([Koenig/#1056](TryGhost/Koenig#1056))
- 🐛 Fixed backspace behaviour at start of aside/quote ([Koenig/#1057](TryGhost/Koenig#1057))
- 🐛 Fixed text having unexpected formats when rendering ([Koenig/#1058](TryGhost/Koenig#1058))
- 🐛 Fixed placeholder descenders being cut off in nested editor ([Koenig/#1059](TryGhost/Koenig#1059))
- 🐛 Fixed HTML->Lexical conversion not handling paragraphs inside blockquotes ([Koenig/#1061](TryGhost/Koenig#1061))
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.

2 participants