mirror of https://github.com/status-im/codimd.git
Fix todo list item class might add in wrong element
This commit is contained in:
parent
9ff3649025
commit
802ed406e6
|
@ -253,7 +253,11 @@ export function finishView (view) {
|
||||||
if (/^\s*\[[x ]\]\s*/.test(html)) {
|
if (/^\s*\[[x ]\]\s*/.test(html)) {
|
||||||
li.innerHTML = html.replace(/^\s*\[ \]\s*/, `<input type="checkbox" class="task-list-item-checkbox "${disabled}><label></label>`)
|
li.innerHTML = html.replace(/^\s*\[ \]\s*/, `<input type="checkbox" class="task-list-item-checkbox "${disabled}><label></label>`)
|
||||||
.replace(/^\s*\[x\]\s*/, `<input type="checkbox" class="task-list-item-checkbox" checked ${disabled}><label></label>`)
|
.replace(/^\s*\[x\]\s*/, `<input type="checkbox" class="task-list-item-checkbox" checked ${disabled}><label></label>`)
|
||||||
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) }
|
if (typeof editor !== 'undefined' && window.havePermission()) { $(li).find('input').change(toggleTodoEvent) }
|
||||||
// color tag in list will convert it to tag icon with color
|
// color tag in list will convert it to tag icon with color
|
||||||
|
|
Loading…
Reference in New Issue