-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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: allow task items to be parsed when only having <li data-checked
instead of only when <li data-checked="true"
(re-fix of #5366)
#5426
Conversation
🦋 Changeset detectedLatest commit: a0c9725 The changes in this PR will be included in the next version bump. This PR includes changesets to release 54 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Did you force pushed some commit to https://github.com/baseballyama/tiptap/commits/develop/ ? (This is my forked repo) Maybe did you intend to push it to ueberdosis:develop? |
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.
LGTM - just not sure if we need the null check or not.
@@ -68,7 +68,7 @@ export const TaskItem = Node.create<TaskItemOptions>({ | |||
parseHTML: element => { | |||
const dataChecked = element.getAttribute('data-checked') | |||
|
|||
return dataChecked == null || dataChecked === 'true' |
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.
Should we still keep the null check here?
return dataChecked === null || dataChecked === '' || dataChecked === 'true'
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.
No I believe we shouldn't.
Case1: <li>
, dataChecked
will be null
,
Case2: <li data-checked>
, dataChecked
will be ''
,
Case3: <li data-checked="true">
, dataChecked
will be 'true'
,
Case3: <li data-checked="false">
, dataChecked
will be 'false'
,
Case1 and case4, checked
attribute should be recognize as false
,
Case 2 and case3, checked
attribute should be recognize as true
,
@baseballyama I force pushed on our You probably have to rebase your branch to the current develop here. |
Understood. |
Changes Overview
When I modified the code in response to the comments in PR #5366, somehow I made the wrong modification. I am very sorry.🙏🙏🙏 @nperez0111
This PR will be correctly amended according to this comment.
I have confirmed that it works correctly with both the REPL created in #5366 and my own product code.
I will take care to avoid similar carelessness.🙏
Implementation Approach
Testing Done
I tested it by manual.
Verification Steps
Additional Notes
Checklist
Related Issues
#5366