From d841cc92ef462c473ce1ae74668c644fbfe30297 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 24 Aug 2019 12:55:40 -0700 Subject: [PATCH] Slightly simplify markdown API --- src/resources/markdown_worker.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/resources/markdown_worker.ts b/src/resources/markdown_worker.ts index 151efbe79f..9c45e697f7 100644 --- a/src/resources/markdown_worker.ts +++ b/src/resources/markdown_worker.ts @@ -2,13 +2,9 @@ import marked from "marked"; // @ts-ignore import filterXSS from "xss"; -export const renderMarkdown = async ( - content: string, - markedOptions: object -) => { - return filterXSS(marked(content, markedOptions), { +export const renderMarkdown = (content: string, markedOptions: object) => + filterXSS(marked(content, markedOptions), { onIgnoreTag(tag, html) { return ["svg", "path", "ha-icon"].indexOf(tag) !== -1 ? html : null; }, }); -};