From 574f8843123b06517eb6a3cd73cdd58fd501796c Mon Sep 17 00:00:00 2001 From: Prathamesh Penshanwar <128643250+PRATHAM777P@users.noreply.github.com> Date: Mon, 27 Apr 2026 23:49:49 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 8: Bad HTML filtering regexp Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/tools/fetch/web-fetch-utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/fetch/web-fetch-utils.ts b/src/tools/fetch/web-fetch-utils.ts index 2779cfb..4a5b8e7 100644 --- a/src/tools/fetch/web-fetch-utils.ts +++ b/src/tools/fetch/web-fetch-utils.ts @@ -40,9 +40,9 @@ export function htmlToMarkdown(html: string): { text: string; title?: string } { do { previous = text; text = text - .replace(//gi, "") - .replace(//gi, "") - .replace(//gi, ""); + .replace(/]*>/gi, "") + .replace(/]*>/gi, "") + .replace(/]*>/gi, ""); } while (text !== previous); text = text.replace(/]*href=["']([^"']+)["'][^>]*>([\s\S]*?)<\/a>/gi, (_, href, body) => { const label = normalizeWhitespace(stripTags(body));