Potential fix for code scanning alert no. 62: Double escaping or unescaping

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:32 -07:00 committed by GitHub
parent 50f4f822b3
commit 8b2176344a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,9 +27,9 @@ export async function cleanNoteContent(content: string, type: string, mime: stri
.replace(/&nbsp;/g, ' ') .replace(/&nbsp;/g, ' ')
.replace(/&lt;/g, '<') .replace(/&lt;/g, '<')
.replace(/&gt;/g, '>') .replace(/&gt;/g, '>')
.replace(/&amp;/g, '&')
.replace(/&quot;/g, '"') .replace(/&quot;/g, '"')
.replace(/&#39;/g, "'"); .replace(/&#39;/g, "'")
.replace(/&amp;/g, '&');
// Normalize whitespace (replace multiple spaces/newlines with single space) // Normalize whitespace (replace multiple spaces/newlines with single space)
content = content.replace(/\s+/g, ' '); content = content.replace(/\s+/g, ' ');