« get me outta code hell

external-links: DeviantArt - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-30 12:17:13 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-03-30 12:17:33 -0300
commitde5a8fc983f9c4921d8b1c56915ad301ff755532 (patch)
tree3b959ef90eef0e456e1cbce5df94c056ed855cbe
parent06d9ed8c51b1dbf1d79f531f153cdbbbcc1b47a5 (diff)
external-links: DeviantArt
-rw-r--r--src/util/external-links.js18
-rw-r--r--tap-snapshots/test/snapshot/linkExternal.js.test.cjs6
-rw-r--r--test/snapshot/linkExternal.js2
3 files changed, 25 insertions, 1 deletions
diff --git a/src/util/external-links.js b/src/util/external-links.js
index d82ba47a..e59cd318 100644
--- a/src/util/external-links.js
+++ b/src/util/external-links.js
@@ -284,6 +284,24 @@ export const externalLinkSpec = [
   },
 
   {
+    match: {domain: '.deviantart.com'},
+
+    platform: 'deviantart',
+    handle: {domain: /^[^.]+/},
+
+    icon: 'deviantart',
+  },
+
+  {
+    match: {domain: 'deviantart.com'},
+
+    platform: 'deviantart',
+    handle: {pathname: /^[^/]+\/?$/},
+
+    icon: 'deviantart',
+  },
+
+  {
     match: {domain: 'deviantart.com'},
     platform: 'deviantart',
     icon: 'deviantart',
diff --git a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
index 7a012a2e..bc061610 100644
--- a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
+++ b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs
@@ -83,7 +83,9 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context
 <a href="https://music.deconreconstruction.com/albums/catch-322" class="nowrap">MUSIC@DCRC</a>
 <a href="https://music.deconreconstruction.com/albums/catch-322?track=arcjecs-theme" class="nowrap">MUSIC@DCRC</a>
 <a href="https://www.deconreconstruction.com/" class="nowrap">Deconreconstruction</a>
-<a href="https://www.deviantart.com/chesswanderlust-sama" class="nowrap">DeviantArt</a>
+<a href="https://culdhira.deviantart.com" class="nowrap">culdhira</a>
+<a href="https://www.deviantart.com/chesswanderlust-sama" class="nowrap">chesswanderlust-sama</a>
+<a href="https://www.deviantart.com/shilloshilloh/art/Homestuck-Jake-English-268874606" class="nowrap">DeviantArt</a>
 <a href="https://mspaintadventures.fandom.com/wiki/Draconian_Dignitary" class="nowrap">MSPA Wiki (Draconian Dignitary)</a>
 <a href="https://mspaintadventures.fandom.com/wiki/" class="nowrap">MSPA Wiki</a>
 <a href="https://mspaintadventures.fandom.com/" class="nowrap">MSPA Wiki</a>
@@ -145,7 +147,9 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context
 <a href="https://music.deconreconstruction.com/albums/catch-322" class="nowrap">MUSIC@DCRC</a>
 <a href="https://music.deconreconstruction.com/albums/catch-322?track=arcjecs-theme" class="nowrap">MUSIC@DCRC</a>
 <a href="https://www.deconreconstruction.com/" class="nowrap">Deconreconstruction</a>
+<a href="https://culdhira.deviantart.com" class="nowrap">DeviantArt</a>
 <a href="https://www.deviantart.com/chesswanderlust-sama" class="nowrap">DeviantArt</a>
+<a href="https://www.deviantart.com/shilloshilloh/art/Homestuck-Jake-English-268874606" class="nowrap">DeviantArt</a>
 <a href="https://mspaintadventures.fandom.com/wiki/Draconian_Dignitary" class="nowrap">MSPA Wiki (Draconian Dignitary)</a>
 <a href="https://mspaintadventures.fandom.com/wiki/" class="nowrap">MSPA Wiki</a>
 <a href="https://mspaintadventures.fandom.com/" class="nowrap">MSPA Wiki</a>
diff --git a/test/snapshot/linkExternal.js b/test/snapshot/linkExternal.js
index a21241e3..7f038bc8 100644
--- a/test/snapshot/linkExternal.js
+++ b/test/snapshot/linkExternal.js
@@ -68,7 +68,9 @@ testContentFunctions(t, 'linkExternal (snapshot)', async (t, evaluate) => {
     'https://www.deconreconstruction.com/',
 
     // platform: deviantart
+    'https://culdhira.deviantart.com',
     'https://www.deviantart.com/chesswanderlust-sama',
+    'https://www.deviantart.com/shilloshilloh/art/Homestuck-Jake-English-268874606',
 
     // platform: fandom.mspaintadventures
     'https://mspaintadventures.fandom.com/wiki/Draconian_Dignitary',