(text: string)
| 71 | // --- 工具函数 --- |
| 72 | |
| 73 | // HTML实体转义 |
| 74 | const isHttpUrl = (text: string): boolean => /^https?:\/\//i.test(text); |
| 75 | const formatRawUrl = (url: string, isTxtOutput: boolean): string => isTxtOutput ? url : htmlEscape(url); |
| 76 | |
| 77 | // Markdown特殊字符转义 (用于TXT输出) |
| 78 | function markdownEscape(text: string): string { |
| 79 | return text.replace(/([*`>#+\-.!_[\](){}])/g, '\\$1'); |
| 80 | } |
| 81 |
no outgoing calls
no test coverage detected