-
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
[lexical-list][lexical-playground] Bug fix: support pasting google doc checklist #6191
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
81da044
to
9740918
Compare
9740918
to
0fc8fc4
Compare
81bedf9
to
0b52e13
Compare
img.parentElement != null && | ||
img.parentElement.tagName === 'LI' && | ||
img.previousSibling === null && | ||
img.src.startsWith('data:image/png;base64,iVBOR') |
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.
this image node has roledescription="checkbox"
IMO it's better to check for it rather then performing base64 match
isHTMLElement(domNode) && | ||
(domNode.getAttribute('aria-checked') === 'true' | ||
? true | ||
: domNode.getAttribute('aria-checked') === 'false' | ||
? false | ||
: undefined); |
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.
Why is the undefined
important here? Nit, can we simplify this nested ternary? We can even retrieve the getAttribute
once which saves us from a second getAttribute
call
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.
the undefined is for non checkbox cases, eg. bullet list. sure will save the getAttribute as var
test failures are from flaky test & unrelated to PR changes. double check on main the same tests fail |
Description
support pasting google doc checklist
Closes #6022
Test plan
added unit test
Before
^ the checkboxes are img so unusable
After