MCPcopy Index your code
hub / github.com/Bistutu/FluentRead / shouldSkipNode

Function shouldSkipNode

entrypoints/main/dom.ts:160–171  ·  view source on GitHub ↗
(node: any, tag: string)

Source from the content-addressed store, hash-verified

158
159// 检查是否应该跳过节点
160function shouldSkipNode(node: any, tag: string): boolean {
161 // 1. 判断标签是否在 skipSet 内
162 // 2. 检查是否具有 notranslate 类
163 // 3. 判断节点是否可编辑
164 // 4. 判断文本是否过长
165 // 5. 判断文本是否为纯数字或标准数字格式(仅当节点内容几乎全是数字时才跳过)
166 return skipSet.has(tag) ||
167 node.classList?.contains('notranslate') ||
168 node.isContentEditable ||
169 checkTextSize(node) ||
170 isMainlyNumericContent(node);
171}
172
173// 检查文本长度
174function checkTextSize(node: any): boolean {

Callers 1

grabNodeFunction · 0.85

Calls 2

checkTextSizeFunction · 0.85
isMainlyNumericContentFunction · 0.85

Tested by

no test coverage detected