summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-03-08 11:22:01 +0100
committerBastien Guerry <bzg@altern.org>2013-03-08 11:22:01 +0100
commite1f42859b4c784fbf4c0c83a357c8457d285047f (patch)
tree58d8ffb88590026a2955861acd7882ee75bff826
parenta2e39d98b81fb03e1a675ded1a5f1d2b71eef9b2 (diff)
downloadorg-mode-e1f42859b4c784fbf4c0c83a357c8457d285047f.tar.gz
ox-html.el (org-html-format-inline-image): Don't add superfluous <p></p> when there is an empty caption
* ox-html.el (org-html-format-inline-image): Don't add superfluous <p></p> when there is an empty caption.
-rw-r--r--lisp/ox-html.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index fbedd06..6497b90 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1207,7 +1207,8 @@ When STANDALONE-P is t, wrap the <img.../> into a <div>...</div>."
(let ((img (format "<img src=\"%s\" %s/>" src attr)))
(format "\n<div%s class=\"figure\">%s%s\n</div>"
id (format "\n<p>%s</p>" img)
- (when caption (format "\n<p>%s</p>" caption)))))
+ (when (and caption (not (string= caption "")))
+ (format "\n<p>%s</p>" caption)))))
(t (format "<img src=\"%s\" %s/>" src (concat attr id))))))
(defun org-html--textarea-block (element)