From 05dc0ecbb79214b8840a3f60550629961da5bf8b Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sun, 8 Sep 2024 12:18:07 +0800 Subject: [PATCH] Fix bug 580 --- app/static/js/word_operation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/static/js/word_operation.js b/app/static/js/word_operation.js index 7ae32fc..6bf076d 100644 --- a/app/static/js/word_operation.js +++ b/app/static/js/word_operation.js @@ -93,7 +93,9 @@ function parseWord(element) { const word = element .querySelector("a.btn.btn-light[role=button]") // 获取当前词频元素的词汇元素 .innerText // 获取词汇值; - const freq = Number.parseInt(element.querySelector(`#freq_${word}`).innerText); // 获取词汇的数量 + let freqId = `freq_${word}`; + freqId = CSS.escape(freqId); // for fixing bug 580, escape the apostrophe in the word + const freq = Number.parseInt(element.querySelector("#"+freqId).innerText); // 获取词汇的数量 return { word, freq