Slightly simplify markdown API

This commit is contained in:
Paulus Schoutsen 2019-08-24 12:55:40 -07:00
parent cdcafe9e6f
commit d841cc92ef

View File

@ -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;
},
});
};