(www-display-object-desc): Add code to link HDIC Viewer from HDIC-SYP
authorMORIOKA Tomohiko <tomo.git@chise.org>
Sat, 15 Jan 2022 17:14:40 +0000 (02:14 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Mon, 17 Jan 2022 00:15:17 +0000 (09:15 +0900)
characters.

cwiki-view.el

index f3830a0..78e306e 100644 (file)
@@ -314,6 +314,18 @@ li { margin: 0 0 0 2em; }
                 (www-format-encode-string
                  (est-format-object object 'readable))))
        )
+       ((and (eq genre 'character)
+            (setq ret (or (encode-char object '=chise-hdic-syp)
+                          (encode-char object '===chise-hdic-syp)))
+            (setq ret (decode-char '===chise-hdic-syp ret))
+            (setq ret (get-char-attribute ret '=hdic-syp-entry-id)))
+       (princ
+        (format "<a href=\"https://viewer.hdic.jp/syp/%s\"
+>%s</a>"
+                ret
+                (www-format-encode-string
+                 (est-format-object object 'readable))))
+       )
        ((or (and (eq genre 'glyph-image)
                 (setq image-cobj
                       (car (concord-object-get object '->image-resource))))