Sfoglia il codice sorgente

Revert "fix type check"

This reverts commit 62c964028089e076bea507c85d49c98bb0ad3f62.
reiji-h 1 anno fa
parent
commit
9796bd54c9

+ 1 - 2
apps/app/src/services/renderer/remark-plugins/attachment.ts

@@ -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 : '',
   };
   };
 };
 };