mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-06 02:43:02 +00:00
Don't output DIV preamble tags when contents is empty.
* org-html.el (org-export-as-html): Make sure the div for preamble is not inserted when the preamble is empty.
This commit is contained in:
parent
3267c69ccd
commit
d85e0e35ec
|
@ -1342,23 +1342,30 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
|
||||
;; insert html preamble
|
||||
(when (plist-get opt-plist :html-preamble)
|
||||
(let ((html-pre (plist-get opt-plist :html-preamble)))
|
||||
(insert "<div id=\"" (nth 0 org-export-html-divs) "\">\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 "<div id=\"" (nth 0 org-export-html-divs) "\">\n")
|
||||
(funcall html-pre)
|
||||
(insert "\n</div>\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</div>\n")))
|
||||
;; don't output an empty preamble DIV
|
||||
(unless (and (functionp html-pre)
|
||||
(equal html-pre-real-contents ""))
|
||||
(insert "<div id=\"" (nth 0 org-export-html-divs) "\">\n")
|
||||
(insert html-pre-real-contents)
|
||||
(insert "\n</div>\n"))))
|
||||
|
||||
;; begin wrap around body
|
||||
(insert (format "\n<div id=\"%s\">"
|
||||
|
|
Loading…
Reference in a new issue