org-html.el: Don't include the caption tag for empty captions in HTML export

* org-html.el (org-format-org-table-html): Don't include the
caption tag for empty captions in HTML export.  Keep it in the
DocBook export so that it produces valid DocBook XML.
This commit is contained in:
Bastien Guerry 2012-08-18 16:58:28 +02:00
parent 7a1bd94df1
commit 8d382158e7
1 changed files with 4 additions and 3 deletions

View File

@ -2141,9 +2141,10 @@ for formatting. This is required for the DocBook exporter."
(if colgropen (setq html (cons (car html)
(cons "</colgroup>" (cdr html)))))
;; Since the output of HTML table formatter can also be used in
;; DocBook document, we want to always include the caption to make
;; DocBook XML file valid.
(push (format "<caption>%s</caption>" (or caption "")) html)
;; DocBook document, include empty captions for the DocBook
;; export only so that it produces valid XML.
(when (or caption (eq org-export-current-backend 'docbook))
(push (format "<caption>%s</caption>" (or caption "")) html))
(when label
(setq html-table-tag (org-export-splice-attributes html-table-tag (format "id=\"%s\"" (org-solidify-link-text label)))))
(push html-table-tag html))