- Mount `=hdic-ktb-seal-glyph-id'.
authorMORIOKA Tomohiko <tomo.git@chise.org>
Fri, 10 Jun 2022 13:48:26 +0000 (22:48 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Tue, 14 Jun 2022 00:28:09 +0000 (09:28 +0900)
- Use `<-HDIC-SYP@tenrei-bansho-meigi' instead of `<-HDIC-SYP@ktb'.
- Use `->HDIC-SYP@tenrei-bansho-meigi' instead of `->HDIC-SYP@ktb'.
- Mount `<-Small-Seal@tenrei-bansho-meigi' and
  `->Small-Seal@tenrei-bansho-meigi'.
(www-format-encode-string): Add setting for `===chise-hdic-ktb-seal'.

cwiki-common.el

index a0914df..a7f0a49 100644 (file)
@@ -66,6 +66,7 @@
 (mount-char-attribute-table '=hdic-tsj-glyph-id)
 (mount-char-attribute-table '=hdic-syp-entry-id)
 (mount-char-attribute-table '=hdic-ktb-entry-id)
+(mount-char-attribute-table '=hdic-ktb-seal-glyph-id)
 (mount-char-attribute-table 'hdic-tsj-word-id)
 (mount-char-attribute-table 'hdic-tsj-word)
 (mount-char-attribute-table 'hdic-tsj-word-description)
 (mount-char-attribute-table 'hdic-ktb-syp-id)
 (mount-char-attribute-table 'hdic-ktb-yy-id)
 (mount-char-attribute-table 'hdic-ktb-ndl-pid)
-(mount-char-attribute-table '<-HDIC-SYP@ktb)
-(mount-char-attribute-table '->HDIC-SYP@ktb)
+(mount-char-attribute-table '<-HDIC-SYP@tenrei-bansho-meigi)
+(mount-char-attribute-table '->HDIC-SYP@tenrei-bansho-meigi)
+(mount-char-attribute-table '<-Small-Seal@tenrei-bansho-meigi)
+(mount-char-attribute-table '->Small-Seal@tenrei-bansho-meigi)
 
 (mount-char-attribute-table 'sound@fanqie)
 
@@ -1199,6 +1202,20 @@ class=\"tooltiptext\">%s</span></div>"
               t 'literal)))
 
          (goto-char (point-min))
+         (while (re-search-forward "&\\(R-\\)?CHISE-HDIC-KTBS\\([0-9A-F]+\\);" nil t)
+           (setq code (string-to-int (match-string 2) 16))
+           (setq char (decode-char '===chise-hdic-ktb-seal code))
+           (when (setq ret (get-char-attribute char '=hdic-ktb-seal-glyph-id))
+             (replace-match
+              (format
+               "<div class=\"tooltip\"><img alt=\"HDIC-KTBS-%s\" src=\"https://hdic.jp/glyphs/KTB-Seal/%s.png\" style=\"
+vertical-align:middle; width: auto; max-height: 60px\"><span
+class=\"tooltiptext\">%s</span></div>"
+               ret ret
+               (charset-description '===chise-hdic-ktb-seal))
+              t 'literal)))
+
+         (goto-char (point-min))
          (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?AJ1-\\([0-9]+\\);" nil t)
            (setq code (string-to-int (match-string 2)))
            (replace-match