From 6250fa8b5815cf1496f1c7d7657a156aa830ace5 Mon Sep 17 00:00:00 2001 From: huangxd- <649924757@qq.com> Date: Thu, 29 Jan 2026 23:47:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DEPISODE=5FTITLE=5FFILTER?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=AD=A3=E5=88=99=E5=AF=BC=E8=87=B4UI?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E9=94=99=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 删除CONVERT_COLOR_TO_WHITE环境变量,合并保留CONVERT_COLOR * 删除环境变量DANMU_SIMPLIFIED和DANMU_TRADITIONAL,合并为DANMU_SIMPLIFIED_TRADITIONAL,弹幕简繁体转换设置:default(默认不转换)、simplified(繁转简)、traditional(简转繁) * 修复EPISODE_TITLE_FILTER中的正则导致UI界面错位的问题 * 删除多余console.log --- README.md | 2 +- danmu_api/configs/globals.js | 2 +- danmu_api/ui/js/main.js | 19 +++++++++++++++++++ danmu_api/ui/js/preview.js | 3 ++- danmu_api/ui/js/systemsettings.js | 4 +++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index df96ed7..61b2bf7 100644 --- a/README.md +++ b/README.md @@ -403,7 +403,7 @@ API 支持返回 Bilibili 标准 XML 格式的弹幕数据,通过查询参数 ```regex # EPISODE_TITLE_FILTER 默认值 -(特别|惊喜|纳凉)?企划(?!(书|案|部))|合伙人手记|超前(营业|vlog)?|速览|vlog|reaction|纯享|加更(版|篇)?|抢先(看|版|集|篇)?|(?': '>', + '"': '"', + "'": ''' + }; + return str.replace(/[&<>"']/g, m => map[m]); +} + // 页面加载完成后初始化 init(); diff --git a/danmu_api/ui/js/preview.js b/danmu_api/ui/js/preview.js index e87c06c..76b7713 100644 --- a/danmu_api/ui/js/preview.js +++ b/danmu_api/ui/js/preview.js @@ -37,11 +37,12 @@ function renderPreview() { if (items && items.length > 0) { html += \`

\${getCategoryName(category)}

\`; items.forEach(item => { + const escapedValue = escapeHtml(item.value); html += \`
\${item.key}
-
\${item.value}
+
\${escapedValue}
\${item.description ? \`
\${item.description}
\` : ''}
diff --git a/danmu_api/ui/js/systemsettings.js b/danmu_api/ui/js/systemsettings.js index 26968aa..2f128a1 100644 --- a/danmu_api/ui/js/systemsettings.js +++ b/danmu_api/ui/js/systemsettings.js @@ -1023,11 +1023,13 @@ function renderEnvList() { item.type === 'multi-select' ? '多选' : '文本'; const badgeClass = item.type === 'multi-select' ? 'multi' : ''; + const escapedValue = escapeHtml(item.value); + return \`
\${item.key}\${typeLabel} -
\${item.value}
+
\${escapedValue}
\${item.description || '无描述'}