merge: branch 'main' into reports
This commit is contained in:
commit
244c13cd84
30 changed files with 207 additions and 435 deletions
11
frontend/src/lib/api/markdown.ts
Normal file
11
frontend/src/lib/api/markdown.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue