emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox-html: Fix meta tag output for properties
@ 2013-06-01 22:12 Kyle Machulis
  0 siblings, 0 replies; only message in thread
From: Kyle Machulis @ 2013-06-01 22:12 UTC (permalink / raw)
  To: emacs-orgmode


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

There are a few document properties (author, description, keywords) that
should automatically be made meta tags if they exist on export. These were
currently being checked as part of an and block that would evaluate both,
creating the string, then just return a newline on success, meaning the
meta tags were never added to the document (since they're part of a larger
concat that never got the string added to it). This patch wraps the needed
logic check into a when, then concats the tag creation and newline addition
to return.

[-- Attachment #1.2: Type: text/html, Size: 563 bytes --]

[-- Attachment #2: 0001-ox-html.el-Fix-output-of-meta-tags-when-properties-a.patch --]
[-- Type: application/octet-stream, Size: 2117 bytes --]

From d0a54cffe8445c2b02b6a150c38ab12c6251bcc7 Mon Sep 17 00:00:00 2001
From: Kyle Machulis <kyle@nonpolynomial.com>
Date: Sat, 1 Jun 2013 15:04:14 -0700
Subject: [PATCH] ox-html.el: Fix output of meta tags when properties are
 present

* lisp/ox-html.el (org-html--build-meta-info): Fix output of meta tags
  when properties are present

TINYCHANGE
---
 lisp/ox-html.el | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index facd84c..5e4ad7b 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1518,24 +1518,25 @@ INFO is a plist used as a communication channel."
       charset) "\n"
      (org-html-close-tag "meta" " name=\"generator\" content=\"Org-mode\"" info)
      "\n"
-     (and (org-string-nw-p author)
-	  (org-html-close-tag "meta"
-			      (format " name=\"author\" content=\"%s\""
-				      (funcall protect-string author))
-			      info)
-	  "\n")
-     (and (org-string-nw-p description)
-	  (org-html-close-tag "meta"
-			      (format " name=\"description\" content=\"%s\"\n"
-				      (funcall protect-string description))
-			      info)
-	  "\n")
-     (and (org-string-nw-p keywords)
-	  (org-html-close-tag "meta"
-			      (format " name=\"keywords\" content=\"%s\""
-				      (funcall protect-string keywords))
-			      info)
-	  "\n"))))
+
+     (when (org-string-nw-p author)
+       (concat (org-html-close-tag "meta"
+				   (format " name=\"author\" content=\"%s\""
+					   (funcall protect-string author))
+				   info)
+	       "\n"))
+     (when (org-string-nw-p description)
+       (concat (org-html-close-tag "meta"
+				   (format " name=\"description\" content=\"%s\""
+					   (funcall protect-string description))
+				   info)
+	       "\n"))
+     (when (org-string-nw-p keywords)
+       (concat (org-html-close-tag "meta"
+				   (format " name=\"keywords\" content=\"%s\""
+					   (funcall protect-string keywords))
+				   info)
+	       "\n")))))
 
 (defun org-html--build-head (info)
   "Return information for the <head>..</head> of the HTML output.
-- 
1.8.2.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-01 22:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-01 22:12 [PATCH] ox-html: Fix meta tag output for properties Kyle Machulis

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).