]> Lady’s Gitweb - GitWikiWeb/commitdiff
Add symbol substitutions
authorLady <redacted>
Fri, 28 Jul 2023 08:38:21 +0000 (01:38 -0700)
committerLady <redacted>
Fri, 28 Jul 2023 08:38:21 +0000 (01:38 -0700)
build.js

index 0544a03217e4407eb18863058ac0486933f7cb8f..b0df7c074b89343d93fb26373ea6cf2cbfcef966 100644 (file)
--- a/build.js
+++ b/build.js
@@ -471,6 +471,35 @@ class GitWikiWebPage {
           },
           exit: (_) => {},
         },
           },
           exit: (_) => {},
         },
+        symb: {
+          enter: (e) => {
+            const { alias } = e;
+            const codepoint = /^U\+([0-9A-Fa-f]+)$/u.exec(alias)?.[1];
+            if (codepoint) {
+              return str`${
+                String.fromCodePoint(parseInt(codepoint, 16))
+              }`;
+            } else {
+              return {
+                "--8": str`${"—\u2060:\u202F"}`, // reverse puppyprick
+                "8--": str`${"\u202F:\u2060—"}`, // forward puppyprick
+                sp: rawInline` `, // space
+                nbsp: str`${"\xA0"}`, // no‐break space
+                cgj: str`${"\u034F"}`, // combining grapheme joiner
+                ensp: str`${"\u2002"}`, // enspace
+                emsp: str`${"\u2003"}`, // emspace
+                figsp: str`${"\u2007"}`, // figure space
+                zwsp: str`${"\u200B"}`, // zero‐width space
+                zwnj: str`${"\u200C"}`, // zero‐width nonjoiner
+                zwj: str`${"\u200D"}`, // zero‐width joiner
+                nnbsp: str`${"\u202F"}`, // narrow no‐break space
+                mathsp: str`${"\u205F"}`, // math space
+                wj: str`${"\u2060"}`, // word joiner
+                fwsp: str`${"\u3000"}`, // fullwidth space
+              }[alias] ?? e;
+            }
+          },
+        },
       };
     });
     Object.defineProperties(this, {
       };
     });
     Object.defineProperties(this, {
This page took 0.023736 seconds and 4 git commands to generate.