Skip to content

Commit

Permalink
IgnoreId恢复为正则规则,并新增规则修复 #240
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Jul 12, 2024
1 parent f58ec7d commit f0042d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions locals.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)/,

/**
* 忽略区域的 标签 正则
Expand Down
2 changes: 1 addition & 1 deletion main.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down

0 comments on commit f0042d5

Please sign in to comment.