From: Lady Date: Sun, 14 May 2023 05:43:50 +0000 (-0700) Subject: Glomp dog’s bollocks X-Git-Url: https://git.ladys.computer/Blog/commitdiff_plain/1015a05f580b5b1d411e19792c9e2ca628b93a77?ds=sidebyside Glomp dog’s bollocks 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. --- diff --git a/build.js b/build.js index e3f78dd..a9d2baf 100755 --- 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—"); } };