« 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/util/external-links.js44
-rw-r--r--tap-snapshots/test/snapshot/linkExternal.js.test.cjs2
2 files changed, 19 insertions, 27 deletions
diff --git a/src/util/external-links.js b/src/util/external-links.js
index edef0701..503512f3 100644
--- a/src/util/external-links.js
+++ b/src/util/external-links.js
@@ -152,32 +152,6 @@ export const externalLinkSpec = [
     icon: 'youtube',
   },
 
-  // Special handling for artist links
-
-  {
-    match: {
-      domain: 'patreon.com',
-      context: 'artist',
-    },
-
-    platform: 'patreon',
-    handle: {pathname: /([^/]+)\/?$/},
-
-    icon: 'globe',
-  },
-
-  {
-    match: {
-      context: 'artist',
-      domain: 'youtube.com',
-    },
-
-    platform: 'youtube',
-    handle: {pathname: /^@([^/]+)\/?$/},
-
-    icon: 'youtube',
-  },
-
   // Special handling for flash links
 
   {
@@ -438,6 +412,15 @@ export const externalLinkSpec = [
 
   {
     match: {domain: 'patreon.com'},
+
+    platform: 'patreon',
+    handle: {pathname: /([^/]+)\/?$/},
+
+    icon: 'globe',
+  },
+
+  {
+    match: {domain: 'patreon.com'},
     platform: 'patreon',
     icon: 'globe',
   },
@@ -497,6 +480,15 @@ export const externalLinkSpec = [
   },
 
   {
+    match: {domain: 'youtube.com'},
+
+    platform: 'youtube',
+    handle: {pathname: /^@([^/]+)\/?$/},
+
+    icon: 'youtube',
+  },
+
+  {
     match: {domains: ['youtube.com', 'youtu.be']},
     platform: 'youtube',
     icon: 'youtube',
diff --git a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
index 754bed12..824bec7b 100644
--- a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
+++ b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
@@ -80,7 +80,7 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context
 <a href="https://en.wikipedia.org/wiki/Haydn_Quartet_(vocal_ensemble)" class="nowrap">Wikipedia</a>
 <a href="https://www.poetryfoundation.org/poets/christina-rossetti" class="nowrap">Poetry Foundation</a>
 <a href="https://www.instagram.com/levc_egm/" class="nowrap">Instagram</a>
-<a href="https://www.patreon.com/CecilyRenns" class="nowrap">Patreon</a>
+<a href="https://www.patreon.com/CecilyRenns" class="nowrap">CecilyRenns</a>
 <a href="https://open.spotify.com/artist/63SNNpNOicDzG3LY82G4q3" class="nowrap">Spotify</a>
 <a href="https://buzinkai.newgrounds.com/" class="nowrap">buzinkai</a>
 <a href="https://music.solatrus.com/" class="nowrap">music.solatrus.com</a>