]> Lady’s Gitweb - Blog/commitdiff
Allow wrapping around emdashes
authorLady <redacted>
Sat, 29 Jul 2023 21:07:01 +0000 (14:07 -0700)
committerLady <redacted>
Sat, 29 Jul 2023 21:07:01 +0000 (14:07 -0700)
build.js

index be96bcdb52dc0407f61212ae80a8a35085a4a0e2..07eeb0ac0ffeefb710f2ecd31fbb78ac2ce07cee 100755 (executable)
--- a/build.js
+++ b/build.js
@@ -74,10 +74,10 @@ const applyTransforms = function (node) {
       // it being rendered as an inline block.
       const prev = node.previousSibling;
       const prevText = prev?.nodeType == 3 ? prev.textContent : "";
-      const prevWrap = prevText.match(/\S*$/u)[0];
+      const prevWrap = prevText.match(/(?:(?!—)\S)*$/u)[0];
       const next = node.nextSibling;
       const nextText = next?.nodeType == 3 ? next.textContent : "";
-      const nextWrap = nextText.match(/^\S*/u)[0];
+      const nextWrap = nextText.match(/^(?:(?!—)\S)*/u)[0];
       if (prevWrap || nextWrap) {
         const span = LMN.span.style("White-Space: Pre")``;
         node.parentNode.replaceChild(span, node);
This page took 0.051828 seconds and 4 git commands to generate.