Skip to content

Commit 802ed40

Browse files
committed
Fix todo list item class might add in wrong element
1 parent 9ff3649 commit 802ed40

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

public/js/extra.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ export function finishView (view) {
253253
if (/^\s*\[[x ]\]\s*/.test(html)) {
254254
li.innerHTML = html.replace(/^\s*\[ \]\s*/, `<input type="checkbox" class="task-list-item-checkbox "${disabled}><label></label>`)
255255
.replace(/^\s*\[x\]\s*/, `<input type="checkbox" class="task-list-item-checkbox" checked ${disabled}><label></label>`)
256-
li.setAttribute('class', 'task-list-item')
256+
if (li.tagName.toLowerCase() !== 'li') {
257+
li.parentElement.setAttribute('class', 'task-list-item')
258+
} else {
259+
li.setAttribute('class', 'task-list-item')
260+
}
257261
}
258262
if (typeof editor !== 'undefined' && window.havePermission()) { $(li).find('input').change(toggleTodoEvent) }
259263
// color tag in list will convert it to tag icon with color

0 commit comments

Comments
 (0)