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

fix(markdown): convert inline CSS from Google Docs to Markdown #7351

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

domcleal
Copy link
Contributor

Summary

Extends the HTML to Markdown conversion to better support bold and italic formatting from Google Docs, which generates inline styles on a span element instead of strong/b/em/i type elements.

This makes it possible to copy limited formatting from Google Docs into the Markdown editor.

Test plan

  1. Create a Google Docs document with bold, italic, bold & italic, and a bold & italic link.
  2. Open the Posts collection in the test backend
  3. Paste into the body and check the formatting matches

Example - copying formatted text from Google Docs into the Markdown editor and it's displaying correctly on the preview:

image

Checklist

Please add a x inside each checkbox:

Extends the HTML to Markdown conversion to better support bold and
italic formatting from Google Docs, which generates inline styles on a
`span` element instead of strong/b/em/i type elements.
@domcleal domcleal marked this pull request as ready for review December 18, 2024 12:46
@domcleal domcleal requested a review from a team as a code owner December 18, 2024 12:46
Copy link
Member

@demshy demshy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works like a charm.

I was going to say that adding some tests would ensure that this feature will transfer to the upcoming Plate editor implementation, but I can see that they already have this covered https://platejs.org/

@demshy demshy merged commit 8b8e873 into decaporg:main Jan 17, 2025
7 checks passed
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