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>
This commit is contained in:
Jon Fuller 2025-04-11 13:31:43 -07:00 committed by GitHub
parent 8b2176344a
commit 6cc4b7e226
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) {