mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Strip null values for changelog and set size limit for large content blocks
This commit is contained in:
@@ -147,7 +147,13 @@ const createMarkdownParser = (showToc = true) => {
|
||||
|
||||
export const md = (markdownContent: string, showToc = true) => {
|
||||
const marked = createMarkdownParser(showToc);
|
||||
const html = DOMPurify.sanitize(marked.parse(markdownContent) as string);
|
||||
let html = "";
|
||||
|
||||
try {
|
||||
html = DOMPurify.sanitize(marked.parse(markdownContent, { async: false }));
|
||||
} catch (_) {
|
||||
html = "Failed to parse markdown";
|
||||
}
|
||||
|
||||
return html;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user