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: convertTextDOMNode now correctly displays colors #5436

Closed
wants to merge 1 commit into from

Conversation

SenaHuang
Copy link

@SenaHuang SenaHuang commented Jan 2, 2024

Resolve color display bug in $generateNodesFromDOM

Copy link

vercel bot commented Jan 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 2:24am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 2, 2024 2:24am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 2, 2024
@ivailop7
Copy link
Collaborator

ivailop7 commented Jan 2, 2024

Is there an open Issue for this PR?

@SenaHuang
Copy link
Author

@ivailop7 I created one for this bug #5441

@ivailop7
Copy link
Collaborator

ivailop7 commented Jan 3, 2024

I'm afraid this won't be merged, because this is a rich-text specific feature and not including it in the core was a deliberate choice some time ago to keep the core library minimal because of people who want to use the framework for plain text and other use cases that don't include rich text. This is why the example in the documentation was provided on how to address the missing HTML styles, color and backgroundColor are just 2 of a very large number of possible style attributes, so even this won't address the core issue at hand. This was discussed a few times in previous GitHub issues.

Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

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

Thank you, this is intentional but not ideal (to fit within our product code). I believe we'll want to introduce a sort of feature flags or an easy way to do replacement and patch this logic in. @acywatson introduced #4254 recently

I'll bring this up to the rest of the team but unfortunately I don't think we can merge this PR as-is and we'll have to find another way :(

@Fetz
Copy link
Contributor

Fetz commented Jan 19, 2024

@SenaHuang thanks for your contribution, like others said, supporting paste of colors doesn't fit most of our use-cases.

I think the best solution is to either improve our documentation on how to create custom paste and/or make it easier and more flexible for devs to create their own custom paste to fit use cases like this without requiring modifying this code.

Please let us know if you have any suggestion (either by PR or comments) how to improve this library to make it easier to create custom paste.

@acywatson acywatson closed this Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants