]> Lady’s Gitweb - Blog/commitdiff
Glomp dog’s bollocks
authorLady <redacted>
Sun, 14 May 2023 05:43:50 +0000 (22:43 -0700)
committerLady <redacted>
Sun, 14 May 2023 06:15:43 +0000 (23:15 -0700)
Some browsers insert a line break between : and —. This can be averted
by inserting a U+2060 WORD JOINER between them, which is easy to
automate during site generation.

build.js

index e3f78dddeb30559a20ae1be74f333d07601d9b9d..a9d2bafc0bb5f624d5654dd3a7f950586e1e5657 100755 (executable)
--- a/build.js
+++ b/build.js
@@ -53,6 +53,8 @@ const applyHighlighting = (node) => {
     }
   } else if (node.nodeType == 1) {
     Array.from(node.childNodes).forEach(applyHighlighting);
+  } else if (node.nodeType == 3) {
+    node.textContent = node.textContent.replaceAll(":—", ":\u2060—");
   }
 };
 
This page took 0.039914 seconds and 4 git commands to generate.