feat: add avatar/bio/links/names/pronouns to user page
This commit is contained in:
parent
412d720abc
commit
862a64840e
16 changed files with 650 additions and 90 deletions
22
Foxnouns.Frontend/app/lib/markdown.ts
Normal file
22
Foxnouns.Frontend/app/lib/markdown.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
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 function renderMarkdown(src: string | null) {
|
||||
return src ? sanitize(md.render(src)) : null;
|
||||
}
|
||||
|
||||
export function renderUnsafeMarkdown(src: string) {
|
||||
return sanitize(unsafeMd.render(src));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue