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): copying html into markdown #7290

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

hip3r
Copy link
Contributor

@hip3r hip3r commented Sep 24, 2024

closes #7233

Summary

When pasting html into markdown, keep styles instead of plain text.
Code copied from official example https://github.com/ianstormtaylor/slate/blob/main/site/examples/ts/paste-html.tsx

Test plan

image
image

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)
image

@hip3r hip3r requested a review from a team as a code owner September 24, 2024 15:29
@martinjagodic martinjagodic requested review from demshy and removed request for a team September 25, 2024 05:43
@mattcen
Copy link

mattcen commented Oct 24, 2024

Nice work on this! Just build a version with this merged in and it coped fine with the simple Google Doc I threw at it! Thanks for your efforts!

UL: () => ({ type: 'bulleted-list' }),
};

// COMPAT: `B` is omitted here because Google Docs uses `<b>` in weird ways.

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great catch.
Slate also noticed and updated this, so I just copied new version of example.

Should the comment, or the B mapping be removed?

Since it's known that Google Docs uses <b> differently, I would leave it removed as is

@demshy demshy merged commit f6959e2 into decaporg:main Nov 12, 2024
9 checks passed
@demshy demshy deleted the 7233-markdown-widget-paste-html branch November 12, 2024 15:23
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.

Formatting lost when copy-pasting from Google Docs to markdown widget
3 participants