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 committed Aug 9, 2024
1 parent baa84db commit d8fd5b7
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 d8fd5b7

Please sign in to comment.