From b6a36b1d1a0063e473b74ff33918b2472cc1e553 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sat, 7 Sep 2024 09:03:59 +0800 Subject: [PATCH] Fix bug 565 --- app/static/js/word_operation.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/static/js/word_operation.js b/app/static/js/word_operation.js index 684d350..7ae32fc 100644 --- a/app/static/js/word_operation.js +++ b/app/static/js/word_operation.js @@ -60,7 +60,13 @@ function delete_word(theWord) { removeWord(theWord); } else { $("#p_" + theWord).remove(); - } + } + // remove highlighting for the word + let highlightedWords = document.querySelectorAll('.highlighted'); + for (let x of highlightedWords) { + if (x.innerHTML == word) + x.replaceWith(x.innerHTML); + } } }); } -- 2.17.1