Skip to content

Commit

Permalink
chore: remove unnecessary type casting in html.ts
Browse files Browse the repository at this point in the history
After the update of marked to v14, the returned type corresponds to the passed ``async`` option, so the casting is no longer necessary.
  • Loading branch information
ferferga authored Aug 9, 2024
1 parent a27ce83 commit 1ce9e67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/utils/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, '<br>');
const inputString = isMarkdown ? (parse(cleanString, { async: false }) as string) : cleanString;
const inputString = isMarkdown ? parse(cleanString, { async: false }) : cleanString;

return DOMPurify.sanitize(
inputString,
Expand Down

0 comments on commit 1ce9e67

Please sign in to comment.