Browse Source

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.
Bastien Guerry 12 years ago
parent
commit
e1f42859b4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/ox-html.el

+ 2 - 1
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)