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)

* fix

* changeset
This commit is contained in:
Yuichiro Yamashita 2024-08-01 07:25:29 +09:00 committed by GitHub
parent 0ec0af67b1
commit 6543f059ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@tiptap/extension-task-item": patch
---
allow task items to be parsed when only having `<li data-checked` instead of only when `<li data-checked="true"` (re-fix of #5366)

View File

@ -68,7 +68,7 @@ export const TaskItem = Node.create<TaskItemOptions>({
parseHTML: element => {
const dataChecked = element.getAttribute('data-checked')
return dataChecked == null || dataChecked === 'true'
return dataChecked === '' || dataChecked === 'true'
},
renderHTML: attributes => ({
'data-checked': attributes.checked,