« get me outta code hell

content, test: linkExternal: fandom page links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-04 19:56:44 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-04 19:56:44 -0300
commit0a2b420891db2832ac5bc7e25cbe3fc2c15859a7 (patch)
treec85855a9e6a05409e3f1666076553aaf06da3701 /src
parent682c8a9591b59959184d6e374d8cdd73c6ddf53d (diff)
content, test: linkExternal: fandom page links
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/linkExternal.js9
-rw-r--r--src/strings-default.json1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js
index c6e4d3ba..b1859dde 100644
--- a/src/content/dependencies/linkExternal.js
+++ b/src/content/dependencies/linkExternal.js
@@ -58,7 +58,14 @@ export default {
 
     : domain.includes('fandom.com')
         ? domain.includes('mspaintadventures.')
-          ? language.$('misc.external.fandom.mspaintadventures')
+          ? data.url.match(/\/wiki\/(.+)\/?$/)
+            ? language.$('misc.external.fandom.mspaintadventures.page', {
+                page:
+                  language.sanitize(
+                    decodeURIComponent(data.url.match(/\/wiki\/(.+)\/?$/)[1])
+                      .replace(/_/g, ' ')),
+              })
+            : language.$('misc.external.fandom.mspaintadventures')
           : language.$('misc.external.fandom')
 
     : domain.includes('soundcloud')
diff --git a/src/strings-default.json b/src/strings-default.json
index bed6d1a7..3a2a4994 100644
--- a/src/strings-default.json
+++ b/src/strings-default.json
@@ -182,6 +182,7 @@
   "misc.external.deviantart": "DeviantArt",
   "misc.external.fandom": "Fandom",
   "misc.external.fandom.mspaintadventures": "MSPA Wiki",
+  "misc.external.fandom.mspaintadventures.page": "MSPA Wiki ({PAGE})",
   "misc.external.instagram": "Instagram",
   "misc.external.mastodon": "Mastodon",
   "misc.external.mastodon.domain": "Mastodon ({DOMAIN})",