summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-24 22:22:47 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-25 17:58:07 +0100
commitb6b1e35f33093f45df1e8973d90889a53b03d53b (patch)
treee81bda5232166beae0c2ba16489cd5c28eb848fe
parentc77b658b39236a45cb9e10e0e44ddfe18e06ee81 (diff)
downloadorg-mode-b6b1e35f33093f45df1e8973d90889a53b03d53b.tar.gz
ox-html: Remove <p> tag around block images when using HTML5
* lisp/ox-html.el (org-html--wrap-image): Do not add a spurious <p> tag when using <figure> to mark images. Reported-by: Matt Price <moptop99@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/111568>
-rw-r--r--lisp/ox-html.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index f46d570..0421455 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1601,12 +1601,12 @@ INFO is a plist used as a communication channel. When optional
arguments CAPTION and LABEL are given, use them for caption and
\"id\" attribute."
(let ((html5-fancy (org-html--html5-fancy-p info)))
- (format (if html5-fancy "\n<figure%s>%s%s\n</figure>"
- "\n<div%s class=\"figure\">%s%s\n</div>")
+ (format (if html5-fancy "\n<figure%s>\n%s%s\n</figure>"
+ "\n<div%s class=\"figure\">\n%s%s\n</div>")
;; ID.
(if (org-string-nw-p label) (format " id=\"%s\"" label) "")
;; Contents.
- (format "\n<p>%s</p>" contents)
+ (if html5-fancy contents (format "<p>%s</p>" contents))
;; Caption.
(if (not (org-string-nw-p caption)) ""
(format (if html5-fancy "\n<figcaption>%s</figcaption>"