diff options
author | Arun Isaac <theroarofthedragon@gmail.com> | 2016-05-26 17:35:42 +0530 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2016-05-26 15:21:01 +0200 |
commit | ddd58ff99a8684f6bcae24ffa5050857f533e26d (patch) | |
tree | a8fd8821361114dfd15bdbd16d4ec2ce8cbcdb34 | |
parent | 655fb3396799082838f80cd04006fffe27e0e1f7 (diff) | |
download | org-mode-ddd58ff99a8684f6bcae24ffa5050857f533e26d.tar.gz |
ox-rss: Encode characters to their XML entities
* contrib/lisp/ox-rss.el (org-rss-build-channel-info, org-rss-headline):
Encode disallowed characters in `title' to their XML entities.
The `title' field is user specified and may contain characters such as
"&", "<" or ">" that are disallowed in XML. These characters should be
encoded into their corresponding XML entities.
-rw-r--r-- | contrib/lisp/ox-rss.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el index 0b5b76a..8b9d319 100644 --- a/contrib/lisp/ox-rss.el +++ b/contrib/lisp/ox-rss.el @@ -246,12 +246,13 @@ communication channel." (format-time-string "%a, %d %b %Y %H:%M:%S %z" (org-time-string-to-time pubdate0))))) - (title (or (org-element-property :RSS_TITLE headline) - (replace-regexp-in-string - org-bracket-link-regexp - (lambda (m) (or (match-string 3 m) - (match-string 1 m))) - (org-element-property :raw-value headline)))) + (title (org-rss-plain-text + (or (org-element-property :RSS_TITLE headline) + (replace-regexp-in-string + org-bracket-link-regexp + (lambda (m) (or (match-string 3 m) + (match-string 1 m))) + (org-element-property :raw-value headline))) info)) (publink (or (and hl-perm (concat (or hl-home hl-pdir) hl-perm)) (concat @@ -316,7 +317,7 @@ as a communication channel." (defun org-rss-build-channel-info (info) "Build the RSS channel information." (let* ((system-time-locale "C") - (title (plist-get info :title)) + (title (org-export-data (plist-get info :title) info)) (email (org-export-data (plist-get info :email) info)) (author (and (plist-get info :with-author) (let ((auth (plist-get info :author))) |