(node: Node, className: string)
| 84 | |
| 85 | // Search for a node with a specific class name |
| 86 | export 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 | |
| 100 | export function contentPostHandler(text: string) { |
| 101 | // 替换掉<think>与</think>之间的内容 |
no outgoing calls
no test coverage detected