« get me outta code hell

content: transformContent: new image attributes inline, pixelate - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-12-06 12:36:30 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-06 12:36:30 -0400
commitd48874a4be60d7455dd6321742102c9cfb77a9f1 (patch)
tree9a8452e6545d1e89e19c5ebf731c5a650b2be13e /src/content/dependencies
parent7c70e24aa8680bb6b14d7e1fd224a091ea21b363 (diff)
content: transformContent: new image attributes inline, pixelate
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/transformContent.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 2002ebee..53341c31 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -369,14 +369,17 @@ export default {
                 ? to('media.path', node.src.slice('media/'.length))
                 : node.src);
 
-            const {link, width, height} = node;
+            const {inline, link, width, height, pixelate} = node;
 
-            if (node.inline) {
+            if (inline) {
               return {
                 type: 'image',
                 inline: true,
                 data:
-                  html.tag('img', {src, width, height}),
+                  html.tag('img', {
+                    src, width, height,
+                    class: pixelate && 'pixelate',
+                  }),
               };
             }
 
@@ -393,6 +396,7 @@ export default {
                     width: width ?? null,
                     height: height ?? null,
                     thumb: slots.thumb,
+                    class: pixelate && 'pixelate',
                   })),
             };
           }