emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Arun Isaac <arunisaac@systemreboot.net>
To: org-mode-email <emacs-orgmode@gnu.org>
Subject: [BUG] [PATCH] ox-rss: Put email address in <author> element
Date: Tue, 14 Jun 2016 01:33:54 +0530	[thread overview]
Message-ID: <87eg80svo5.fsf@systemreboot.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 365 bytes --]


The RSS specification requires the email address and the name of the
author to be provided in the <author> element in the format
"email@domain.com (Name)".

http://www.rssboard.org/rss-specification#ltauthorgtSubelementOfLtitemgt

Currently, only the author's name is provided. This is invalid
RSS. Please find attached a patch fixing this.

Regards,
Arun Isaac.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: ox-rss-Put-email-address-in-author-element.patch --]
[-- Type: text/x-diff, Size: 1975 bytes --]

From f5e2bf625cc14efd35dcd77340b4ab380b2f3dc8 Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Tue, 14 Jun 2016 01:18:55 +0530
Subject: [PATCH] ox-rss: Put email address in <author> element

* contrib/lisp/ox-rss.el (org-rss-headline): Put author's email
  address in <author> element.

The RSS specification requires the email address and the name of the
author to be provided in the <author> element in the format
"email@domain.com (Name)". Currently, only the author's name is
provided. This is invalid RSS.
---
 contrib/lisp/ox-rss.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 44ee8db..a3ba274 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -231,7 +231,8 @@ communication channel."
   (if (> (org-export-get-relative-level headline info) 1)
       (org-export-data-with-backend headline 'html info)
     (unless (org-element-property :footnote-section-p headline)
-      (let* ((author (and (plist-get info :with-author)
+      (let* ((email (org-export-data (plist-get info :email) info))
+	     (author (and (plist-get info :with-author)
 			  (let ((auth (plist-get info :author)))
 			    (and auth (org-export-data auth info)))))
 	     (htmlext (plist-get info :html-extension))
@@ -275,13 +276,13 @@ communication channel."
 	    "<item>\n"
 	    "<title>%s</title>\n"
 	    "<link>%s</link>\n"
-	    "<author>%s</author>\n"
+	    "<author>%s (%s)</author>\n"
 	    "<guid isPermaLink=\"false\">%s</guid>\n"
 	    "<pubDate>%s</pubDate>\n"
 	    (org-rss-build-categories headline info) "\n"
 	    "<description><![CDATA[%s]]></description>\n"
 	    "</item>\n")
-	   title publink author guid pubdate contents))))))
+	   title publink email author guid pubdate contents))))))
 
 (defun org-rss-build-categories (headline info)
   "Build categories for the RSS item."
-- 
2.8.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

             reply	other threads:[~2016-06-13 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 20:03 Arun Isaac [this message]
2016-06-14 11:57 ` [BUG] [PATCH] ox-rss: Put email address in <author> element Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg80svo5.fsf@systemreboot.net \
    --to=arunisaac@systemreboot.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).