Browse Source

ox-html: Handle missing title better

* ox-html.el (org-html-template): Only insert title when nonnil.

Empty headings trigger a W3 Validator warning.
Rasmus 10 years ago
parent
commit
a95e9da223
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lisp/ox-html.el

+ 4 - 3
lisp/ox-html.el

@@ -1866,9 +1866,10 @@ holding export options."
      (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
    ;; Document title.
    (when (plist-get info :with-title)
-       (let ((title (plist-get info :title)))
-	 (format "<h1 class=\"title\">%s</h1>\n"
-		 (org-export-data (or title "") info))))
+     (let ((title (org-export-data
+		   (or (plist-get info :title) "") info)))
+       (when (org-string-nw-p title)
+	 (format "<h1 class=\"title\">%s</h1>\n" title))))
    contents
    (format "</%s>\n" (nth 1 (assq 'content (plist-get info :html-divs))))
    ;; Postamble.