diff --git a/app/static/js/highlight.js b/app/static/js/highlight.js index c9c3a02..0349c60 100644 --- a/app/static/js/highlight.js +++ b/app/static/js/highlight.js @@ -43,12 +43,12 @@ function highLight() { // 删除所有的mark标签,防止标签发生嵌套 articleContent = articleContent.replace(/<(mark)[^>]*>/gi, ""); articleContent = articleContent.replace(/<(\/mark)[^>]*>/gi, ""); - // 将文章中所有出现该单词word的地方改为:"" + word + ""。 + // 将文章中所有出现该单词word的地方改为:"" + word + ""。 for (let word of totalSet) { - articleContent = articleContent.replace(new RegExp("\\b" + word + "\\b", "g"), "" + word + ""); + articleContent = articleContent.replace(new RegExp("\\b" + word + "\\b", "g"), "" + word + ""); } document.getElementById("article").innerHTML = articleContent; - + $('mark').css('padding', 0); } function cancelHighlighting() {