From ae3fac05e0d2ae6c654e2d23b66a9c63709a4f94 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 1 Mar 2024 07:50:19 -0400 Subject: content, css, test: tweak external link white-space handling --- src/content/dependencies/linkExternal.js | 2 +- src/static/site6.css | 8 + .../test/snapshot/linkExternal.js.test.cjs | 366 ++++++++++----------- 3 files changed, 192 insertions(+), 184 deletions(-) diff --git a/src/content/dependencies/linkExternal.js b/src/content/dependencies/linkExternal.js index 2de1bc7..7a97762 100644 --- a/src/content/dependencies/linkExternal.js +++ b/src/content/dependencies/linkExternal.js @@ -51,8 +51,8 @@ export default { }); } + linkAttributes.set('class', 'external-link'); linkAttributes.set('href', data.url); - linkAttributes.set('class', 'nowrap'); if (slots.tab === 'separate') { linkAttributes.set('target', '_blank'); diff --git a/src/static/site6.css b/src/static/site6.css index a29158c..3d707f2 100644 --- a/src/static/site6.css +++ b/src/static/site6.css @@ -468,6 +468,10 @@ a:not([href]):hover { text-decoration: none; } +.external-link { + white-space: nowrap; +} + .nav-main-links .nav-link.current > span.nav-link-content > a { font-weight: 800; } @@ -801,6 +805,10 @@ ul.image-details li { font-style: oblique; } +.commentary-entry-body .external-link { + white-space: normal; +} + .commentary-art { float: right; width: 30%; diff --git a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs index 8f5a9b4..03192e8 100644 --- a/tap-snapshots/test/snapshot/linkExternal.js.test.cjs +++ b/tap-snapshots/test/snapshot/linkExternal.js.test.cjs @@ -6,223 +6,223 @@ */ 'use strict' exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: album, style: handle 1`] = ` -YouTube -YouTube -YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: album, style: platform 1`] = ` -YouTube -YouTube -YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: albumMultipleTracks, style: handle 1`] = ` -YouTube (full album) -YouTube (full album) -YouTube +YouTube (full album) +YouTube (full album) +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: albumMultipleTracks, style: platform 1`] = ` -YouTube (full album) -YouTube (full album) -YouTube +YouTube (full album) +YouTube (full album) +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: albumNoTracks, style: handle 1`] = ` -YouTube -YouTube -YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: albumNoTracks, style: platform 1`] = ` -YouTube -YouTube -YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: albumOneTrack, style: handle 1`] = ` -YouTube -YouTube -YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: albumOneTrack, style: platform 1`] = ` -YouTube -YouTube -YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: flash, style: handle 1`] = ` -bgreco.net (high quality audio) -Homestuck (page 1234) -Homestuck (secret page) -YouTube (on any device) -YouTube (on any device) -some.external.site +bgreco.net (high quality audio) +Homestuck (page 1234) +Homestuck (secret page) +YouTube (on any device) +YouTube (on any device) +some.external.site ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: flash, style: platform 1`] = ` -bgreco.net (high quality audio) -Homestuck (page 1234) -Homestuck (secret page) -YouTube (on any device) -YouTube (on any device) -some.external.site +bgreco.net (high quality audio) +Homestuck (page 1234) +Homestuck (secret page) +YouTube (on any device) +YouTube (on any device) +some.external.site ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: generic, style: handle 1`] = ` -Apple Music -eevaningtea -witnesstheabsurd -music.solatrus.com -homestuck -jacobtheloofah -aliceflare -bigchaslappa -cosmoptera -MUSIC@DCRC -MUSIC@DCRC -Deconreconstruction -culdhira -chesswanderlust-sama -DeviantArt -DoomedCloud -WoodenToaster -Facebook -MSPA Wiki (Draconian Dignitary) -MSPA Wiki -MSPA Wiki -Fandom -Fandom -Fandom -GameBanana -GameBanana -Homestuck -HSMusic (wiki archive) -HSMusic -Internet Archive -Internet Archive -bass.and.noises -levc_egm -tuyoki -bravelittletoreador -gnaach -bbpanzu -types.pl -MSPFA -MSPFA -MSPFA -wodaro.neocities.org -neomints.neocities.org -buzinkai -Newgrounds -CecilyRenns -Poetry Foundation -Poetry Foundation -plazmataz -SoundCloud -Spotify -Spotify -Spotify -richaadeb -ghastaboo -aeritus -vol5anthology -electricwestern -Tumblr -ajhebard -vargskelethor/ -awkwarddoesart -purenonsens -Twitter -Wayback Machine -Wayback Machine -Wikipedia -bani-chan8949 -Razzie16 -YouTube -YouTube -YouTube -YouTube +Apple Music +eevaningtea +witnesstheabsurd +music.solatrus.com +homestuck +jacobtheloofah +aliceflare +bigchaslappa +cosmoptera +MUSIC@DCRC +MUSIC@DCRC +Deconreconstruction +culdhira +chesswanderlust-sama +DeviantArt +DoomedCloud +WoodenToaster +Facebook +MSPA Wiki (Draconian Dignitary) +MSPA Wiki +MSPA Wiki +Fandom +Fandom +Fandom +GameBanana +GameBanana +Homestuck +HSMusic (wiki archive) +HSMusic +Internet Archive +Internet Archive +bass.and.noises +levc_egm +tuyoki +bravelittletoreador +gnaach +bbpanzu +types.pl +MSPFA +MSPFA +MSPFA +wodaro.neocities.org +neomints.neocities.org +buzinkai +Newgrounds +CecilyRenns +Poetry Foundation +Poetry Foundation +plazmataz +SoundCloud +Spotify +Spotify +Spotify +richaadeb +ghastaboo +aeritus +vol5anthology +electricwestern +Tumblr +ajhebard +vargskelethor/ +awkwarddoesart +purenonsens +Twitter +Wayback Machine +Wayback Machine +Wikipedia +bani-chan8949 +Razzie16 +YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > context: generic, style: platform 1`] = ` -Apple Music -ArtStation -ArtStation -Bandcamp (music.solatrus.com) -Bandcamp -Bluesky -Carrd -Carrd -Cohost -MUSIC@DCRC -MUSIC@DCRC -Deconreconstruction -DeviantArt -DeviantArt -DeviantArt -Facebook -Facebook -Facebook -MSPA Wiki (Draconian Dignitary) -MSPA Wiki -MSPA Wiki -Fandom -Fandom -Fandom -GameBanana -GameBanana -Homestuck -HSMusic (wiki archive) -HSMusic -Internet Archive -Internet Archive -Instagram -Instagram -itch.io -itch.io -Ko-fi -Linktree -Mastodon (types.pl) -MSPFA -MSPFA -MSPFA -Neocities -Neocities -Newgrounds -Newgrounds -Patreon -Poetry Foundation -Poetry Foundation -SoundCloud -SoundCloud -Spotify -Spotify -Spotify -TikTok -Toyhouse -Tumblr -Tumblr -Tumblr -Tumblr -Twitch -Twitch -Twitter -Twitter -Twitter -Wayback Machine -Wayback Machine -Wikipedia -YouTube -YouTube -YouTube -YouTube -YouTube -YouTube +Apple Music +ArtStation +ArtStation +Bandcamp (music.solatrus.com) +Bandcamp +Bluesky +Carrd +Carrd +Cohost +MUSIC@DCRC +MUSIC@DCRC +Deconreconstruction +DeviantArt +DeviantArt +DeviantArt +Facebook +Facebook +Facebook +MSPA Wiki (Draconian Dignitary) +MSPA Wiki +MSPA Wiki +Fandom +Fandom +Fandom +GameBanana +GameBanana +Homestuck +HSMusic (wiki archive) +HSMusic +Internet Archive +Internet Archive +Instagram +Instagram +itch.io +itch.io +Ko-fi +Linktree +Mastodon (types.pl) +MSPFA +MSPFA +MSPFA +Neocities +Neocities +Newgrounds +Newgrounds +Patreon +Poetry Foundation +Poetry Foundation +SoundCloud +SoundCloud +Spotify +Spotify +Spotify +TikTok +Toyhouse +Tumblr +Tumblr +Tumblr +Tumblr +Twitch +Twitch +Twitter +Twitter +Twitter +Wayback Machine +Wayback Machine +Wikipedia +YouTube +YouTube +YouTube +YouTube +YouTube +YouTube ` exports[`test/snapshot/linkExternal.js > TAP > linkExternal (snapshot) > unknown domain (arbitrary world wide web path) 1`] = ` -snoo.ping.as +snoo.ping.as ` -- cgit 1.3.0-6-gf8a5