MCPcopy
hub / github.com/Bistutu/FluentRead / searchClassName

Function searchClassName

entrypoints/utils/check.ts:86–98  ·  view source on GitHub ↗
(node: Node, className: string)

Source from the content-addressed store, hash-verified

84
85// Search for a node with a specific class name
86export function searchClassName(node: Node, className: string): Node | null {
87 if (node instanceof Element && node.classList.contains(className)) return node;
88
89 // Check children only if the node is an Element
90 if (node instanceof Element) {
91 for (let child of node.children) {
92 let result = searchClassName(child, className);
93 if (result) return result;
94 }
95 }
96
97 return null;
98}
99
100export function contentPostHandler(text: string) {
101 // 替换掉<think>与</think>之间的内容

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected