This commit is contained in:
Joseph Cheung 2023-03-01 22:18:15 +08:00
parent f951b48e41
commit 8f16390022
2 changed files with 6 additions and 1043 deletions

File diff suppressed because one or more lines are too long

View file

@ -1291,6 +1291,11 @@ function modal_open(url, num)
fulltext = fulltext.replaceAll("\n\n","\n").replaceAll("\n\n","\n"); fulltext = fulltext.replaceAll("\n\n","\n").replaceAll("\n\n","\n");
const delimiter = /[?!;\?\n]/g const delimiter = /[?!;\?\n]/g
fulltext = fulltext.split(delimiter); fulltext = fulltext.split(delimiter);
fulltext = fulltext.filter((item) => {
// 使用正则表达式匹配仅由数字逗号和空格组成的字符串
const regex = /^[0-9,\s]+$/;
return !regex.test(item);
});
fulltext = fulltext.filter(function(item) { fulltext = fulltext.filter(function(item) {
return item && item.trim(); // 去掉空值和空格 return item && item.trim(); // 去掉空值和空格
}); });