From d8fd5b7aba4a380cb23f20ecbaab7b05a3ed3e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Fri, 9 Aug 2024 14:06:53 +0200 Subject: [PATCH] chore: remove unnecessary type casting in html.ts After the update of marked to v14, the returned type corresponds to the passed ``async`` option, so the casting is no longer necessary. --- frontend/src/utils/html.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/utils/html.ts b/frontend/src/utils/html.ts index df661550497..3e2c1a01966 100644 --- a/frontend/src/utils/html.ts +++ b/frontend/src/utils/html.ts @@ -13,7 +13,7 @@ import { parse } from 'marked'; export function sanitizeHtml(input: string, isMarkdown = false): string { // Some providers have newlines, replace them with the proper tag. const cleanString = input.replaceAll(/\r\n|\r|\n/g, '
'); - const inputString = isMarkdown ? (parse(cleanString, { async: false }) as string) : cleanString; + const inputString = isMarkdown ? parse(cleanString, { async: false }) : cleanString; return DOMPurify.sanitize( inputString,