From a4bff99ceecfad33f69d2d227404bc6bfd1cd4b8 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Fri, 29 Oct 2021 22:32:25 +0200 Subject: [PATCH] Fix TODO/DONE line-through --- editor/src/editor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/src/editor.js b/editor/src/editor.js index fe9917c..efbd8cd 100644 --- a/editor/src/editor.js +++ b/editor/src/editor.js @@ -388,9 +388,9 @@ function Editor(holder, input) { } try { - const todoItem = $(converted).find(':checkbox') - if (todoItem.length) { - const todo = !todoItem.is(':checked') + const todoItem = $.parseHTML(converted) + if (todoItem.length && $(todoItem[0]).is(':checkbox')) { + const todo = !$(todoItem[0]).is(':checked') element.toggleClass('todo--done', todo === false) element.toggleClass('todo--todo', todo === true) } else {