diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-07-01 15:11:46 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-07-01 15:11:46 +0200 |
commit | 88429d7270947693fea8a3ee47604486eb78eac1 (patch) | |
tree | c7702c5d1b3d5944ca5f51d7a75a6713b917874f | |
parent | f1924d9224cb69033be49063654b234f33ffddfa (diff) | |
parent | ea47dd58ffabe55f710e1ea673b22e4c4e4fd3ef (diff) | |
download | org-mode-88429d7270947693fea8a3ee47604486eb78eac1.tar.gz |
Merge branch 't/patch57'
-rw-r--r-- | lisp/org-feed.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/org-feed.el b/lisp/org-feed.el index b0373e5..2621008 100644 --- a/lisp/org-feed.el +++ b/lisp/org-feed.el @@ -267,6 +267,17 @@ have been saved." (defvar org-feed-buffer "*Org feed*" "The buffer used to retrieve a feed.") +(defun org-feed-unescape (s) + "Unescape protected entities in S." + (let ((re (concat "&\\(" + (mapconcat (lambda (e) + (car e)) xml-entity-alist "\\|") + "\\);"))) + (while (string-match re s) + (setq s (replace-match + (cdr (assoc (match-string 1 s) xml-entity-alist)) nil nil s))) + s)) + ;;;###autoload (defun org-feed-update-all () "Get inbox items from all feeds in `org-feed-alist'." @@ -647,10 +658,10 @@ formatted as a string, not the original XML data." (cond ((string= type "text") ;; We like plain text. - (setq entry (plist-put entry :description (car (xml-node-children content))))) + (setq entry (plist-put entry :description (org-feed-unescape (car (xml-node-children content)))))) ((string= type "html") ;; TODO: convert HTML to Org markup. - (setq entry (plist-put entry :description (car (xml-node-children content))))) + (setq entry (plist-put entry :description (org-feed-unescape (car (xml-node-children content)))))) ((string= type "xhtml") ;; TODO: convert XHTML to Org markup. (setq entry (plist-put entry :description (prin1-to-string (xml-node-children content))))) |