-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add highlight TextFormatType #3583
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I wonder if this might come over confusing because we already have a |
Ah! Didn't know this use case was already covered 🙈 . I'll close the PR then. |
Duplicated functionality |
Re-opening the PR after playing with the MarkNode for a few days, and finding its usage not the best in some use cases. |
Could you describe cases where existing marks are not fitting? |
Yes, of course. The simplest one is where the user wants to re-adjust the range selection. Let's take a simple text with two words:
And the user wants to highlight only I know it's a silly example, but it reflects that the UX of selecting/highlighting text with an element node rather than a text node format is cumbersome. |
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.
After thinking about this more. It makes sense for your use case. MarkNode elements do have slightly different heuristics that are more about structure than styling/formatting. Thanks for the PR.
Pull request facebook#3583 by @moy2010 added a new textformat (which is helpful), but if we use HTML to serialize it gets lost because importDOM is not parsing the mark. - Added the missing mark entry - Added a highlight formatting menu entry to playground for manual testing (including icon, and CSS theme) - added the missing entry in devtools to show format: highlight - added a test to check for mark on html past
Add a new
highlight
variant toTextFormatType
, to cover the use case of highlighted text.