(mixi-encode-specials-string): New function.
* mixi-atom.el (mixi-make-atom-entry): Use it.
* mixi-atom.el (mixi-atom-self): New constant.
(mixi-make-atom): Use it.
+2007-09-10 OHASHI Akira <bg66@koka-in.org>
+
+ * mixi.el (mixi-entity-alist): New constant.
+ (mixi-encode-specials-string): New function.
+ * mixi-atom.el (mixi-make-atom-entry): Use it.
+
+ * mixi-atom.el (mixi-atom-self): New constant.
+ (mixi-make-atom): Use it.
+
2007-07-25 OHASHI Akira <bg66@koka-in.org>
* mixi.el (mixi-topic-comment-list-regexp): Fix regexp.
:type 'string
:group 'mixi)
+(defcustom mixi-atom-self ""
+ "*URI for retrieving Atom Feed Documents representing this Atom feed."
+ :type 'string
+ :group 'mixi)
+
(defcustom mixi-atom-title "Mixi Feed"
"*Title for feed."
:type 'string
" <id>" (mixi-make-tag-uri object) "</id>\n"
" <updated>" (mixi-atom-make-date (mixi-object-time object))
"</updated>\n"
- " <summary>" (mixi-remove-markup (mixi-make-content object))
+ " <summary>" (mixi-encode-specials-string
+ (mixi-remove-markup (mixi-make-content object)))
"</summary>\n"
"</entry>\n"))
(concat "<?xml version=\"1.0\" encoding=\""
(symbol-name mixi-atom-coding-system) "\"?>\n"
"<feed xmlns=\"" mixi-atom-namespace "\">\n"
+ "<link rel=\"self\" href=\"" mixi-atom-self "\"/>\n"
"\n"
"<title>" mixi-atom-title "</title>\n"
"<link href=\"" mixi-url "\"/>\n"
(buffer-string)))
;; stolen (and modified) from w3m.el
+(defconst mixi-entity-alist '(("gt" . ">")
+ ("lt" . "<")
+ ("amp" . "&"))
+ "Alist of html character entities and values.")
+
+;; stolen (and modified) from w3m.el
+(defun mixi-encode-specials-string (str)
+ "Encode special characters in the string STR."
+ (let ((pos 0)
+ (buf))
+ (while (string-match "[<>&]" str pos)
+ (setq buf
+ (cons ";"
+ (cons (car (rassoc (match-string 0 str) mixi-entity-alist))
+ (cons "&"
+ (cons (substring str pos (match-beginning 0))
+ buf))))
+ pos (match-end 0)))
+ (if buf
+ (apply 'concat (nreverse (cons (substring str pos) buf)))
+ str)))
+
+;; stolen (and modified) from w3m.el
(defun mixi-url-encode-string (string)
(apply (function concat)
(mapcar