Skip to content

Build your personal knowledge base with Trilium Notes

Potential fix for code scanning alert no. 55: Useless regular-expression character escape

Jon Fuller6cc4b7e2260b
diff --git a/src/services/llm/tools/content_extraction_tool.ts b/src/services/llm/tools/content_extraction_tool.ts
index 121220713d..0a1a18cd7c 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(`<h${i}[^>]*>([\s\S]*?)<\/h${i}>`, 'gi');
+ const headingRegex = new RegExp(`<h${i}[^>]*>([\\s\\S]*?)<\/h${i}>`, 'gi');
let headingMatch;
while ((headingMatch = headingRegex.exec(content)) !== null) {