"标签,防止标签发生嵌套
+ articleContent = articleContent.replace(new RegExp('',"gi"), "")
+ articleContent = articleContent.replace(new RegExp("","gi"), "");
+ // 将文章中所有出现该单词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;
}
function cancelHighlighting() {
let articleContent = document.getElementById("article").innerHTML;
- articleContent = articleContent.replace(/<(mark)[^>]*>/gi, "");
- articleContent = articleContent.replace(/<(\/mark)[^>]*>/gi, "");
+ articleContent = articleContent.replace(new RegExp('',"gi"), "")
+ articleContent = articleContent.replace(new RegExp("","gi"), "");
document.getElementById("article").innerHTML = articleContent;
}
@@ -73,6 +81,7 @@ function toggleHighlighting() {
isHighlight = true;
highLight();
}
+ localStorage.setItem('highlightChecked', isHighlight);
}
showBtnHandler();
\ No newline at end of file
diff --git a/app/templates/login.html b/app/templates/login.html
index b8eb118..b0806b6 100644
--- a/app/templates/login.html
+++ b/app/templates/login.html
@@ -15,6 +15,10 @@
alert('输入不能为空!');
return false;
}
+ if (password.includes(' ')) {
+ alert('输入不能包含空格!');
+ return false;
+ }
$.post(
"/login", {'username': username, 'password': password},
function (response) {
diff --git a/app/templates/mainpage_get.html b/app/templates/mainpage_get.html
index db54e55..288e289 100644
--- a/app/templates/mainpage_get.html
+++ b/app/templates/mainpage_get.html
@@ -34,9 +34,9 @@
共有文章 {{ number_of_essays }} 篇 其中Oxford覆盖率为: {{ coverage_percentage }}%
粘贴1篇文章 (nglish only)
{% if d_len > 0 %}
最常见的词
@@ -52,5 +52,22 @@
{% endfor %}
{% endif %}
+