+ (goto-char (point-min))
+ (while (re-search-forward "&HNG\\([0-9]+\\)-\\([0-9][0-9][0-9][0-9]\\)\\([0-9]\\);" nil t)
+ (setq plane (match-string 1)
+ code (string-to-int (match-string 2))
+ subcode (string-to-int (match-string 3)))
+ (setq subcode
+ (if (eq subcode 0)
+ ""
+ (char-to-string (decode-char 'ascii (+ 96 subcode)))))
+ (replace-match
+ (format
+ "<div class=\"tooltip\"><img alt=\"HNG%s-%04d%s\" src=\"%s/%s/%04d%s.png\" style=\"
+vertical-align:middle; width: auto; max-height: 60px\"><span
+class=\"tooltiptext\">%s</span></div>"
+ plane code subcode
+ chise-wiki-hng-bitmap-glyphs-url
+ plane code subcode
+ (charset-description
+ (car (find (format "HNG%s-" plane)
+ coded-charset-entity-reference-alist
+ :test (lambda (key cell)
+ (string= key (nth 1 cell))))))
+ )
+ 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
+ (format "<img alt=\"AJ1-%05d\" src=\"%s/IVD/AdobeJapan1/CID+%d.png\"
+style=\"vertical-align:middle\">"
+ code
+ chise-wiki-bitmap-glyphs-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&\\(A-\\|o-\\|G-\\|g2-\\|R-\\)?MJ\\([0-9]+\\);" nil t)
+ (setq code (string-to-int (match-string 2)))
+ (replace-match
+ (format "<img alt=\"MJ%06d\" src=\"http://mojikiban.ipa.go.jp/MJ%06d.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 "&\\(o-\\|G-\\|g2-\\)?IU[+-]\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 2) 16))
+ (replace-match
+ (format "<img alt=\"u%04x\" src=\"http://glyphwiki.org/glyph/u%04x.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 "&A-\\(comp\\|cgn\\)U[+-]\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 2) 16))
+ (replace-match
+ (format "<img alt=\"u%04x\" src=\"http://glyphwiki.org/glyph/u%04x.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
+ "&\\(A-\\|g2-\\)?U-i\\([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=\"u%04x-itaiji-%03d\" src=\"http://glyphwiki.org/glyph/u%04x-itaiji-%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-IWDSU\\+\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 1) 16))
+ (replace-match
+ (format "<img alt=\"A-IWDSU+%04x\" src=\"http://glyphwiki.org/glyph/u%04x.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
+ "&\\(A-\\)?CDP-i\\([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-itaiji-%03d\" src=\"http://glyphwiki.org/glyph/cdp-%04x-itaiji-%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 "&\\(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))
+ (replace-match
+ (format "<img alt=\"u%04x-var-%03d\" src=\"http://glyphwiki.org/glyph/u%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-\\|G-\\|R-\\|g2-\\)?GT-\\([0-9]+\\);" nil t)
+ (setq code (string-to-int (match-string 2)))
+ (replace-match
+ (format "<img alt=\"GT-%05d\" src=\"%s?char=GT-%05d\"
+style=\"%s\">"
+ code
+ chise-wiki-glyph-cgi-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&\\(A-\\|G-\\|g2-\\)?GT-K\\([0-9]+\\);" nil t)
+ (setq code (string-to-int (match-string 2)))
+ (replace-match
+ (format "<img alt=\"GT-K%05d\" src=\"%s?char=GT-K%05d\"
+style=\"%s\">"
+ code
+ chise-wiki-glyph-cgi-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&B-\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 1) 16))
+ (replace-match
+ (format "<img alt=\"B-%04X\" src=\"%s?char=B-%04X\"
+style=\"%s\">"
+ code
+ chise-wiki-glyph-cgi-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward
+ "&\\(A-\\|G-\\|g2-\\|R-\\)?CDP-\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 2) 16))
+ (replace-match
+ (format "<img alt=\"CDP-%04X\" src=\"%s?char=CDP-%04X\"
+style=\"%s\">"
+ code
+ chise-wiki-glyph-cgi-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward
+ "&\\(I-\\)?HZK\\(0[1-9]\\|1[0-2]\\)-\\([0-9A-F]+\\);" nil t)
+ (setq plane (match-string 2)
+ code (string-to-int (match-string 3) 16))
+ (replace-match
+ (format "<img alt=\"HZK%s-%04X\" src=\"%s?char=HZK%s-%04X\"
+style=\"%s\">"
+ plane
+ code
+ chise-wiki-glyph-cgi-url
+ plane
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?RUI6-\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 2) 16))
+ (replace-match
+ (format "<img alt=\"RUI6-%04X\" src=\"%s?char=RUI6-%04X\"
+style=\"vertical-align:middle\">"
+ code
+ chise-wiki-glyph-cgi-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&hanaJU\\+\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 1) 16))
+ (replace-match
+ (format "<img alt=\"hanaJU+%04X\" src=\"%s?char=hana-JU+%04X\"
+style=\"vertical-align:middle\">"
+ code
+ chise-wiki-glyph-cgi-url
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 3) 16))
+ (replace-match
+ (format "<img alt=\"UU+%04X\" src=\"http://www.unicode.org/cgi-bin/refglyph?24-%04X\"
+style=\"vertical-align:middle\">"
+ code
+ code
+ www-format-char-img-style)
+ t 'literal))
+
+ (goto-char (point-min))
+ (while (re-search-forward "&MCS-\\([0-9A-F]+\\);" nil t)
+ (setq code (string-to-int (match-string 1) 16))
+ (setq start (match-beginning 0)
+ end (match-end 0))
+ (setq char (decode-char 'system-char-id code))
+ (cond
+ ((and (setq variants
+ (or (www-get-feature-value char '->subsumptive)
+ (www-get-feature-value char '->denotational)))
+ (progn
+ (if (characterp variants)
+ (setq variants (list variants)))
+ (while (and variants
+ (setq ret (www-format-encode-string
+ (char-to-string (car variants))))
+ (string-match "&MCS-\\([0-9A-F]+\\);" ret))
+ (setq variants (cdr variants)))
+ ret))
+ (unless (string-match "&MCS-\\([0-9A-F]+\\);" ret)
+ (goto-char start)
+ (delete-region start end)
+ (insert ret))
+ )
+ ((setq ret (or (www-get-feature-value char 'ideographic-combination)
+ (www-get-feature-value char 'ideographic-structure)))
+ (setq ret
+ (mapconcat
+ (lambda (ch)
+ (if (listp ch)
+ (if (characterp (setq rret (find-char ch)))
+ (setq ch rret)))
+ (if (characterp ch)
+ (www-format-encode-string
+ (char-to-string ch) without-tags)
+ (www-format-encode-string
+ (format "%S" ch) without-tags)))
+ ret ""))
+ (when ret
+ (goto-char start)
+ (delete-region start end)
+ (insert ret))
+ )))
+ ))
+ ;; (goto-char (point-min))
+ ;; (while (search-forward ">-" nil t)
+ ;; (replace-match "&GT-" t 'literal))
+ (buffer-string))))