(www-format-encode-string): Format &(A-)CDP-vddd-hhhh; and
authorMORIOKA Tomohiko <tomo.git@chise.org>
Mon, 15 Jun 2020 06:37:29 +0000 (15:37 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Mon, 15 Jun 2020 06:37:29 +0000 (15:37 +0900)
&(A-)M-ddddd; to display with GlyphWiki glyphs.

cwiki-common.el

index 336f9d4..dbd983b 100644 (file)
@@ -1183,6 +1183,35 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">"
             t 'literal))
 
          (goto-char (point-min))
+         (while (re-search-forward
+                 "&\\(A-\\)?CDP-v\\([0-9]+\\)-\\([0-9A-F]+\\);"
+                 nil t)
+           (setq plane (string-to-int (match-string 2))
+                 code (string-to-int (match-string 3) 16))
+           (replace-match
+            (format "<img alt=\"cdp-%04x-var-%03d\" src=\"http://glyphwiki.org/glyph/cdp-%04x-var-%03d.100px.png\"
+style=\"vertical-align:middle; width: 48px; height: 48px\">"
+                    code
+                    plane
+                    code
+                    plane
+                    www-format-char-img-style)
+            t 'literal))
+
+         (goto-char (point-min))
+         (while (re-search-forward
+                 "&\\(A-\\)?M-\\([0-9]+\\);"
+                 nil t)
+           (setq code (string-to-int (match-string 2)))
+           (replace-match
+            (format "<img alt=\"dkw-%05d\" src=\"http://glyphwiki.org/glyph/dkw-%05d.100px.png\"
+style=\"vertical-align:middle; width: 48px; height: 48px\">"
+                    code
+                    code
+                    www-format-char-img-style)
+            t 'literal))
+
+         (goto-char (point-min))
          (while (re-search-forward "&\\(g2-\\)?U-v\\([0-9]+\\)\\+\\([0-9A-F]+\\);" nil t)
            (setq plane (string-to-int (match-string 2))
                  code (string-to-int (match-string 3) 16))