« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/content/dependencies/transformContent.js8
-rw-r--r--src/util/replacer.js6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 84881016..69030224 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -229,7 +229,7 @@ export default {
             const {
               link,
               style,
-              warning,
+              warnings,
               width,
               height,
               pixelate,
@@ -264,13 +264,9 @@ export default {
                     link: link ?? true,
                     width: width ?? null,
                     height: height ?? null,
+                    warnings: warnings ?? null,
                     thumb: slots.thumb,
 
-                    warnings:
-                      (warning
-                        ? warning.split(', ')
-                        : null),
-
                     attributes: [
                       {class: 'content-image'},
 
diff --git a/src/util/replacer.js b/src/util/replacer.js
index 8e6cac7b..2c0e89f1 100644
--- a/src/util/replacer.js
+++ b/src/util/replacer.js
@@ -495,11 +495,15 @@ export function postprocessImages(inputNodes) {
 
         if (attributes.get('link')) imageNode.link = attributes.get('link');
         if (attributes.get('style')) imageNode.style = attributes.get('style');
-        if (attributes.get('warning')) imageNode.warning = attributes.get('warning');
         if (attributes.get('width')) imageNode.width = parseInt(attributes.get('width'));
         if (attributes.get('height')) imageNode.height = parseInt(attributes.get('height'));
         if (attributes.get('pixelate')) imageNode.pixelate = true;
 
+        if (attributes.get('warning')) {
+          imageNode.warnings =
+            attributes.get('warning').split(', ');
+        }
+
         outputNodes.push(imageNode);
 
         // No longer at the start of a line after an image - there will at