Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -29,10 +29,23 @@ const markdownRenderer = new Marked({
|
||||
},
|
||||
});
|
||||
|
||||
const chatMarkdownRenderer = new Marked({
|
||||
renderer: {
|
||||
html: (token) => escapeRawHtml(typeof token === "string" ? token : (token?.text ?? token?.raw ?? "")),
|
||||
image: (token) => (typeof token === "string" ? token : (token?.text ?? "")),
|
||||
},
|
||||
});
|
||||
|
||||
export function renderSanitizedMarkdown(markdown: string | null | undefined) {
|
||||
return sanitizeMarkedHtml(markdownRenderer.parse(markdown ?? "", { async: false }) as string);
|
||||
}
|
||||
|
||||
/** Chat messages never load remote inline images. Attachments must pass through
|
||||
* the Files pipeline; markdown images degrade to their inert alt text. */
|
||||
export function renderSanitizedChatMarkdown(markdown: string | null | undefined) {
|
||||
return sanitizeMarkedHtml(chatMarkdownRenderer.parse(markdown ?? "", { async: false }) as string);
|
||||
}
|
||||
|
||||
export function sanitizeMarkedHtml(html: string | null | undefined) {
|
||||
const unsafeHtml = html ?? "";
|
||||
if (typeof DOMParser !== "undefined") {
|
||||
|
||||
Reference in new issue
Block a user