From: MORIOKA Tomohiko Date: Fri, 19 Mar 2010 05:48:10 +0000 (+0900) Subject: (www-format-encode-string): Display &U-hhhhhhhh;. X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fest.git;a=commitdiff_plain;h=6d278f1c3d4f0f940c24b25ea534f0644f6a2a4d (www-format-encode-string): Display &U-hhhhhhhh;. (www-xml-format-props): Encode property value. (www-xml-format-unit): Encode string. --- diff --git a/cwiki-common.el b/cwiki-common.el index 4f62691..f6aa4ad 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -532,8 +532,8 @@ t 'literal)) (goto-char (point-min)) - (while (re-search-forward "&UU\\+\\([0-9A-F]+\\);" nil t) - (setq code (string-to-int (match-string 1) 16)) + (while (re-search-forward "&\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) (replace-match (format "\"UU+%04X\"" code @@ -721,14 +721,24 @@ (setq key (substring key 1))) (setq dest (format "%s %s=\"%s\"" - dest key val))) + dest key + (www-format-encode-string + (format "%s" val) 'without-tags)))) dest)) (defun www-xml-format-unit (format-unit) (let (name props children ret) (cond ((stringp format-unit) - format-unit) + (www-format-encode-string format-unit 'without-tags) + ;; (mapconcat (lambda (c) + ;; (cond + ;; ((eq c ?<) "&lt;") + ;; ((eq c ?>) "&gt;") + ;; (t + ;; (char-to-string c)))) + ;; format-unit "") + ) ((consp format-unit) (setq name (car format-unit) props (nth 1 format-unit)