From aa5d0ec5e792b5c4b1464a91c0ec6291a281230e Mon Sep 17 00:00:00 2001 From: Prathamesh Penshanwar <128643250+PRATHAM777P@users.noreply.github.com> Date: Mon, 27 Apr 2026 23:58:21 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 11: Incomplete multi-character sanitization Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/tools/fetch/web-fetch-utils.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/fetch/web-fetch-utils.ts b/src/tools/fetch/web-fetch-utils.ts index feb249c..d5179e6 100644 --- a/src/tools/fetch/web-fetch-utils.ts +++ b/src/tools/fetch/web-fetch-utils.ts @@ -37,10 +37,7 @@ export function htmlToMarkdown(html: string): { text: string; title?: string } { let previous: string; do { previous = text; - text = text - .replace(/]*>/gi, "") - .replace(/]*>/gi, "") - .replace(/]*>/gi, ""); + text = text.replace(/[<>]/g, ""); } while (text !== previous); text = text.replace(/]*href=["']([^"']+)["'][^>]*>([\s\S]*?)<\/a>/gi, (_, href, body) => { const label = normalizeWhitespace(stripTags(body));