feat: 支持對話視頻, wip: 文件

This commit is contained in:
CrescentLeaf
2025-10-02 11:14:07 +08:00
parent bc5485d622
commit dfeed305e1
2 changed files with 19 additions and 1 deletions

View File

@@ -33,7 +33,6 @@ const markedInstance = new marked.Marked({
},
image({ text, href }) {
const type = /^(Video|File)=.*/.exec(text)?.[1] || 'Image'
if (/uploaded_files\/[A-Za-z0-9]+$/.test(href)) {
return ({
Image: `<chat-image src="${href}" alt="${text}"></chat-image>`,
@@ -272,6 +271,8 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
const rendeText = DOMPurify.sanitize(markedInstance.parse(msg.text) as string, {
ALLOWED_TAGS: [
"chat-image",
"chat-video",
"chat-file",
"span",
"chat-link",
],