瀏覽代碼

Try to fix SVG image failed to render.

Thanks to xet7 !

Fixes #4830
Lauri Ojansivu 2 年之前
父節點
當前提交
7a3c340d65
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      client/components/cards/attachments.jade

+ 3 - 1
client/components/cards/attachments.jade

@@ -42,7 +42,9 @@ template(name="attachmentsGalery")
       .attachment-item
         a.attachment-thumbnail.swipebox(href="{{link}}" title="{{sanitize name}}")
           if link
-            if isImage
+            if($eq extension 'svg')
+              img.attachment-thumbnail-img(src="{{link}}" title="{{sanitize name}}" type="image/svg+xml")
+            else if isImage
               img.attachment-thumbnail-img(src="{{link}}" title="{{sanitize name}}")
             else if($eq extension 'mp3')
               video(width="100%" height="100%" title="{{sanitize name}}" controls="true")