u
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user