This commit is contained in:
seb
2026-10-06 11:49:10 +02:00
parent 4769a87c54
commit cbf669f640
6 changed files with 384 additions and 563 deletions

View File

@@ -9,6 +9,7 @@ import {
TABLE_HEADER_PAIR,
byMode,
} from '../../colors';
import { VfsAttachmentLink, parseAttachmentTag } from './ChatAttachmentItems';
/**
* Healing markdown renderer.
@@ -522,6 +523,28 @@ function parseInline(src, keyPrefix = 'i') {
}
if (c === '[') {
// Attachment tag: [ATTACHMENT name="..." path="..." type=...]
if (src.startsWith('[ATTACHMENT', i)) {
const closeTag = src.indexOf(']', i + 11);
if (closeTag !== -1) {
const attrStr = src.slice(i + 11, closeTag);
const parsed = parseAttachmentTag(attrStr);
if (parsed.name || parsed.path) {
push(
<VfsAttachmentLink
key={key()}
name={parsed.name}
path={parsed.path}
type={parsed.type}
isUser={false}
/>,
);
i = closeTag + 1;
continue;
}
}
}
const close = src.indexOf(']', i + 1);
if (close !== -1) {
const label = src.slice(i + 1, close);