-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Is there an open Issue for this PR? |
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. |
There was a problem hiding this 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 :(
@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. |
Resolve color display bug in $generateNodesFromDOM