[feat] generate by web

This commit is contained in:
kwaroran
2023-07-17 23:37:05 +09:00
parent 168b89f20c
commit 44c81e10f9
6 changed files with 340 additions and 5 deletions

View File

@@ -105,13 +105,14 @@ export async function ParseMarkdown(data:string, char:(character | groupChat) =
return DOMPurify.sanitize(mconverted.parse(data), {
ADD_TAGS: ["iframe"],
ADD_ATTR: ["allow", "allowfullscreen", "frameborder", "scrolling"],
FORBID_ATTR: ["href"]
})
}
export function parseMarkdownSafe(data:string) {
return DOMPurify.sanitize(safeConvertor.makeHtml(data), {
FORBID_TAGS: ["a", "style"],
FORBID_ATTR: ["style"]
FORBID_ATTR: ["style", "href"]
})
}