From 6cc4b7e2260bd7e7e1e2a1ae50f6c20f684db9d7 Mon Sep 17 00:00:00 2001 From: Jon Fuller Date: Fri, 11 Apr 2025 13:31:43 -0700 Subject: [PATCH] Potential fix for code scanning alert no. 55: Useless regular-expression character escape Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/services/llm/tools/content_extraction_tool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/llm/tools/content_extraction_tool.ts b/src/services/llm/tools/content_extraction_tool.ts index 121220713..0a1a18cd7 100644 --- a/src/services/llm/tools/content_extraction_tool.ts +++ b/src/services/llm/tools/content_extraction_tool.ts @@ -249,7 +249,7 @@ export class ContentExtractionTool implements ToolHandler { const headings = []; for (let i = 1; i <= 6; i++) { - const headingRegex = new RegExp(`]*>([\s\S]*?)<\/h${i}>`, 'gi'); + const headingRegex = new RegExp(`]*>([\\s\\S]*?)<\/h${i}>`, 'gi'); let headingMatch; while ((headingMatch = headingRegex.exec(content)) !== null) {