ryoji-s 2 лет назад
Родитель
Сommit
4dce9937bb

+ 1 - 1
apps/app/src/client/services/renderer/slide-viewer-renderer.tsx

@@ -38,7 +38,7 @@ export const generatePresentationViewOptions = (
     drawio.remarkPlugin,
     drawio.remarkPlugin,
     mermaid.remarkPlugin,
     mermaid.remarkPlugin,
     xsvToTable.remarkPlugin,
     xsvToTable.remarkPlugin,
-    attachment.remarkPlugin,
+    [attachment.remarkPlugin, { isSharedPage: config.isSharedPage }],
     lsxGrowiDirective.remarkPlugin,
     lsxGrowiDirective.remarkPlugin,
     refsGrowiDirective.remarkPlugin,
     refsGrowiDirective.remarkPlugin,
   );
   );

+ 2 - 2
apps/app/src/components/ReactMarkdownComponents/RichAttachment.tsx

@@ -13,7 +13,7 @@ type RichAttachmentProps = {
   attachmentId: string,
   attachmentId: string,
   url: string,
   url: string,
   attachmentName: string,
   attachmentName: string,
-  isSharedPage?: boolean,
+  isSharedPage: 'true' | 'false',
 }
 }
 
 
 export const RichAttachment = React.memo((props: RichAttachmentProps) => {
 export const RichAttachment = React.memo((props: RichAttachmentProps) => {
@@ -70,7 +70,7 @@ export const RichAttachment = React.memo((props: RichAttachmentProps) => {
               <a className="ml-2 attachment-download" href={downloadPathProxied}>
               <a className="ml-2 attachment-download" href={downloadPathProxied}>
                 <i className="icon-cloud-download" />
                 <i className="icon-cloud-download" />
               </a>
               </a>
-              {isSharedPage ?? (
+              {isSharedPage === 'false' && (
                 <a className="ml-2 text-danger attachment-delete" onClick={onClickTrashButtonHandler}>
                 <a className="ml-2 text-danger attachment-delete" onClick={onClickTrashButtonHandler}>
                   <i className="icon-trash" />
                   <i className="icon-trash" />
                 </a>
                 </a>

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

@@ -21,7 +21,7 @@ const rewriteNode = (node: Node, isSharedPage?: boolean) => {
     attachmentId,
     attachmentId,
     url: node.url,
     url: node.url,
     attachmentName: (node.children as any)[0]?.value,
     attachmentName: (node.children as any)[0]?.value,
-    isSharedPage,
+    isSharedPage: isSharedPage ? 'true' : 'false',
   };
   };
 };
 };