diff options
Diffstat (limited to 'src/misc-templates.js')
-rw-r--r-- | src/misc-templates.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/misc-templates.js b/src/misc-templates.js index 139978d8..a6b39b99 100644 --- a/src/misc-templates.js +++ b/src/misc-templates.js @@ -199,8 +199,17 @@ export function getAlbumStylesheet(album, {to}) { // Fancy lookin' links export function fancifyURL(url, {strings, album = false} = {}) { - const domain = new URL(url).hostname; + let local = Symbol(); + let domain; + try { + domain = new URL(url).hostname; + } catch (error) { + // No support for relative local URLs yet, sorry! (I.e, local URLs must + // be absolute relative to the domain name in order to work.) + domain = local; + } return fixWS`<a href="${url}" class="nowrap">${ + domain === local ? strings('misc.external.local') : domain.includes('bandcamp.com') ? strings('misc.external.bandcamp') : [ 'music.solatrux.com' |