From e3fb325b7be63fa7bcf16cffce4b508b4aee8c97 Mon Sep 17 00:00:00 2001 From: Moyasee Date: Fri, 3 Oct 2025 15:57:06 +0300 Subject: [PATCH] fix: eslint fix --- src/shared/html-sanitizer.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/shared/html-sanitizer.ts b/src/shared/html-sanitizer.ts index 7d7012f6..839c3b11 100644 --- a/src/shared/html-sanitizer.ts +++ b/src/shared/html-sanitizer.ts @@ -1,6 +1,6 @@ function removeZalgoText(text: string): string { - // eslint-disable-next-line no-misleading-character-class const zalgoRegex = + // eslint-disable-next-line no-misleading-character-class /[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/g; return text.replace(zalgoRegex, ""); @@ -8,14 +8,14 @@ function removeZalgoText(text: string): string { function decodeHtmlEntities(text: string): string { const entityMap: { [key: string]: string } = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - ' ': ' ', + "&": "&", + "<": "<", + ">": ">", + """: '"', + "'": "'", + " ": " ", }; - + return text.replace(/&[#\w]+;/g, (entity) => { return entityMap[entity] || entity; });