« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util/link.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/link.js')
-rw-r--r--src/util/link.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/util/link.js b/src/util/link.js
index e5c3c59..107b35f 100644
--- a/src/util/link.js
+++ b/src/util/link.js
@@ -14,15 +14,21 @@ import { getLinkThemeString } from './colors.js'
 
 const linkHelper = (hrefFn, {color = true, attr = null} = {}) =>
     (thing, {
-        strings, to,
+        to,
         text = '',
+        attributes = null,
         class: className = '',
+        color: color2 = true,
         hash = ''
     }) => (
         html.tag('a', {
             ...attr ? attr(thing) : {},
+            ...attributes ? attributes : {},
             href: hrefFn(thing, {to}) + (hash ? (hash.startsWith('#') ? '' : '#') + hash : ''),
-            style: color ? getLinkThemeString(thing.color) : '',
+            style: (
+                typeof color2 === 'string' ? getLinkThemeString(color2) :
+                color2 && color ? getLinkThemeString(thing.color) :
+                ''),
             class: className
         }, text || thing.name)
     );