Don't wrap figures without captions

This is to allow better figure placement.
This commit is contained in:
Carsten Dominik 2009-10-02 08:29:21 +02:00
parent cd7d2eb68e
commit f026e3a6b8
2 changed files with 16 additions and 8 deletions

View File

@ -1,5 +1,8 @@
2009-10-02 Carsten Dominik <carsten.dominik@gmail.com>
* org-html.el (org-export-html-format-image): Wrap image into
figure div only when there is a caption.
* org-archive.el (org-archive-mark-done): Change default value to
nil.

View File

@ -1505,17 +1505,22 @@ lang=\"%s\" xml:lang=\"%s\">
(let* ((caption (org-find-text-property-in-string 'org-caption src))
(attr (org-find-text-property-in-string 'org-attributes src))
(label (org-find-text-property-in-string 'org-label src)))
(format "%s<div %sclass=\"figure\">
<p><img src=\"%s\"%s /></p>%s
</div>%s"
(if org-par-open "</p>\n" "")
(if label (format "id=\"%s\" " label) "")
(concat
(if caption
(format "%s<div %sclass=\"figure\">
<p>"
(if org-par-open "</p>\n" "")
(if label (format "id=\"%s\" " label) "")))
(format "<img src=\"%s\"%s />"
src
(if (string-match "\\<alt=" (or attr ""))
(concat " " attr )
(concat " " attr " alt=\"" src "\""))
(if caption (concat "\n<p>" caption "</p>") "")
(if org-par-open "\n<p>" ""))))))
(concat " " attr " alt=\"" src "\"")))
(if caption
(format "</p>%s
</div>%s"
(concat "\n<p>" caption "</p>")
(if org-par-open "\n<p>" ""))))))))
(defun org-export-html-get-bibliography ()
"Find bibliography, cut it out and return it."