From de5a8fc983f9c4921d8b1c56915ad301ff755532 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Mar 2024 12:17:13 -0300 Subject: external-links: DeviantArt --- src/util/external-links.js | 18 ++++++++++++++++++ tap-snapshots/test/snapshot/linkExternal.js.test.cjs | 6 +++++- test/snapshot/linkExternal.js | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) 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 @@ -283,6 +283,24 @@ export const externalLinkSpec = [ icon: 'globe', }, + { + 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', 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 MUSIC@DCRC MUSIC@DCRC Deconreconstruction -DeviantArt +culdhira +chesswanderlust-sama +DeviantArt MSPA Wiki (Draconian Dignitary) MSPA Wiki MSPA Wiki @@ -145,7 +147,9 @@ exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context MUSIC@DCRC MUSIC@DCRC Deconreconstruction +DeviantArt DeviantArt +DeviantArt MSPA Wiki (Draconian Dignitary) MSPA Wiki MSPA Wiki 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', -- cgit 1.3.0-6-gf8a5