From f0042d5af6f8f55dfeb80759add1f1ca2ebd6c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=99=E6=BC=A0=E4=B9=8B=E5=AD=90?= <7850715+maboloshi@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:15:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86`IgnoreId`=E6=81=A2=E5=A4=8D=E4=B8=BA?= =?UTF-8?q?=E6=AD=A3=E5=88=99=E8=A7=84=E5=88=99=EF=BC=8C=E5=B9=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=A7=84=E5=88=99=E4=BF=AE=E5=A4=8D=20#240?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locals.js | 5 +++-- main.user.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/locals.js b/locals.js index 065408241..e434d0f6e 100644 --- a/locals.js +++ b/locals.js @@ -97,10 +97,11 @@ I18N.conf = { /** * 忽略区域的 特定元素id 正则 - * offset /blob页面 符号-->引用 + * /blob页面 offset 符号-->引用 + * /blob页面 右侧 符号筛选 filter-results * fix repo详情页文件路径breadcrumb */ - reIgnoreId: ['readme', 'offset', 'breadcrumb', 'file-name-id'], + reIgnoreId: /(readme|^offset|breadcrumb|file-name-id|filter-results)/, /** * 忽略区域的 标签 正则 diff --git a/main.user.js b/main.user.js index e89b2eae2..51b613d1c 100644 --- a/main.user.js +++ b/main.user.js @@ -97,7 +97,7 @@ */ function traverseNode(node) { // 跳过忽略 - if (I18N.conf.reIgnoreId.includes(node.id) || + if (I18N.conf.reIgnoreId.test(node.id) || I18N.conf.reIgnoreClass.test(node.className) || I18N.conf.reIgnoreTag.includes(node.tagName) || (node.getAttribute && I18N.conf.reIgnoreItemprop.test(node.getAttribute("itemprop")))