From 5614d6e2c42fcb350bdef04246d30e68370d1048 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Thu, 20 Mar 2025 21:27:06 -0300 Subject: content: transformContent: absorb punct. for image media links --- src/content/dependencies/transformContent.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/content') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index bdfcbeb5..34f37261 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -460,6 +460,18 @@ export default { link.setSlot('tooltipStyle', 'none'); } + let doTheAbsorbyThing = false; + + // TODO: This is just silly. + try { + const tag = html.resolve(link, {normalize: 'tag'}); + doTheAbsorbyThing ||= tag.attributes.has('class', 'image-media-link'); + } catch {} + + if (doTheAbsorbyThing) { + absorbFollowingPunctuation(link); + } + return {type: 'processed-internal-link', data: link}; } -- cgit 1.3.0-6-gf8a5