« get me outta code hell

html: Attributes: push() util - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util/replacer.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-16 15:19:30 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-16 15:19:30 -0300
commit9da32b4b2e255801307caa8f62b7dd49aafcf96b (patch)
tree6dbdef800aa4dc7fabaef7fdab87ab0404bc3a97 /src/util/replacer.js
parentadf0adde987a368298e135c23ce307efbc38d888 (diff)
html: Attributes: push() util
Diffstat (limited to 'src/util/replacer.js')
-rw-r--r--src/util/replacer.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/util/replacer.js b/src/util/replacer.js
index ac23bf4..028cd3b 100644
--- a/src/util/replacer.js
+++ b/src/util/replacer.js
@@ -382,10 +382,7 @@ export function postprocessHeadings(inputNodes) {
       parseFrom = match.index + match[0].length;
 
       const attributes = html.attributes(parseAttributes(match[1]));
-
-      attributes.set('class',
-        (attributes.get('class') ?? [])
-          .concat(['content-heading']));
+      attributes.push('class', 'content-heading');
 
       // We're only modifying the opening tag here. The remaining content,
       // including the closing tag, will be pushed as-is.