diff --git a/public/js/extra.js b/public/js/extra.js
index ffd95a272..d237a2f21 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -253,7 +253,11 @@ export function finishView (view) {
if (/^\s*\[[x ]\]\s*/.test(html)) {
li.innerHTML = html.replace(/^\s*\[ \]\s*/, ``)
.replace(/^\s*\[x\]\s*/, ``)
- li.setAttribute('class', 'task-list-item')
+ if (li.tagName.toLowerCase() !== 'li') {
+ li.parentElement.setAttribute('class', 'task-list-item')
+ } else {
+ li.setAttribute('class', 'task-list-item')
+ }
}
if (typeof editor !== 'undefined' && window.havePermission()) { $(li).find('input').change(toggleTodoEvent) }
// color tag in list will convert it to tag icon with color