|
@@ -15,14 +15,13 @@ const isAttachmentLink = (url: string): boolean => {
|
|
|
|
|
|
|
|
const rewriteNode = (node: Link) => {
|
|
const rewriteNode = (node: Link) => {
|
|
|
const attachmentId = path.basename(node.url);
|
|
const attachmentId = path.basename(node.url);
|
|
|
- const attachmentName = node.children[0] != null && node.children[0].type === 'text' ? node.children[0].value : '';
|
|
|
|
|
|
|
|
|
|
const data = node.data ?? (node.data = {});
|
|
const data = node.data ?? (node.data = {});
|
|
|
data.hName = 'attachment';
|
|
data.hName = 'attachment';
|
|
|
data.hProperties = {
|
|
data.hProperties = {
|
|
|
attachmentId,
|
|
attachmentId,
|
|
|
url: node.url,
|
|
url: node.url,
|
|
|
- attachmentName,
|
|
|
|
|
|
|
+ attachmentName: 'value' in node.children[0] ? node.children[0].value : '',
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|