you know what let's just change frontend framework again
This commit is contained in:
parent
c8cd483d20
commit
0d47f1fb01
115 changed files with 4407 additions and 10824 deletions
18
Foxnouns.Frontend/src/lib/markdown.ts
Normal file
18
Foxnouns.Frontend/src/lib/markdown.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import MarkdownIt from "markdown-it";
|
||||
import sanitize from "sanitize-html";
|
||||
|
||||
const md = new MarkdownIt({
|
||||
html: false,
|
||||
breaks: true,
|
||||
linkify: true,
|
||||
}).disable(["heading", "lheading", "link", "table", "blockquote"]);
|
||||
|
||||
const unsafeMd = new MarkdownIt({
|
||||
html: false,
|
||||
breaks: true,
|
||||
linkify: true,
|
||||
});
|
||||
|
||||
export const renderMarkdown = (src: string | null) => (src ? sanitize(md.render(src)) : null);
|
||||
|
||||
export const renderUnsafeMarkdown = (src: string) => sanitize(unsafeMd.render(src));
|
Loading…
Add table
Add a link
Reference in a new issue