feat: use markdown-it instead of marked for descriptions

This commit is contained in:
Sam 2023-03-23 10:05:17 +01:00
parent 90667bc285
commit da67d12b60
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
7 changed files with 89 additions and 29 deletions

View file

@ -0,0 +1,11 @@
import MarkdownIt from "markdown-it";
import sanitize from "sanitize-html";
const md = new MarkdownIt({
html: false,
breaks: true,
}).disable(["heading", "link", "table"]);
export default function renderMarkdown(src: string | null) {
return src ? sanitize(md.render(src)) : null;
}