From 9bb3959f8ca978e7486ba7bde11cd407a40e653b Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Thu, 29 Sep 2011 21:49:11 +0200 Subject: [PATCH 2/2] Don't output DIV preamble tags when contents is empty. --- lisp/org-html.el | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/org-html.el b/lisp/org-html.el index fde563b..0139c16 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1337,23 +1337,30 @@ lang=\"%s\" xml:lang=\"%s\"> ;; insert html preamble (when (plist-get opt-plist :html-preamble) - (let ((html-pre (plist-get opt-plist :html-preamble))) - (insert "
\n") + (let ((html-pre (plist-get opt-plist :html-preamble)) + html-pre-real-contents) (cond ((stringp html-pre) - (insert - (format-spec html-pre `((?t . ,title) (?a . ,author) - (?d . ,date) (?e . ,email))))) + (setq html-pre-real-contents + (format-spec html-pre `((?t . ,title) (?a . ,author) + (?d . ,date) (?e . ,email))))) ((functionp html-pre) - (funcall html-pre)) + (insert "
\n") + (funcall html-pre) + (insert "\n
\n")) (t - (insert + (setq html-pre-real-contents (format-spec (or (cadr (assoc (nth 0 lang-words) org-export-html-preamble-format)) (cadr (assoc "en" org-export-html-preamble-format))) `((?t . ,title) (?a . ,author) (?d . ,date) (?e . ,email)))))) - (insert "\n
\n"))) + ;; don't output an empty preamble DIV + (unless (and (functionp html-pre) + (equal html-pre-real-contents "")) + (insert "
\n") + (insert html-pre-real-contents) + (insert "\n
\n")))) ;; begin wrap around body (insert (format "\n
" -- 1.7.5.1