Hello,

Rasmus <ras...@gmx.us> writes:

> I'm not an expert of HTML either.  However, the "p" tag inside the
> "figure" is uncommon looking a bit on the example usages online.  Thus, I
> agree with Matt that it should probably not be there.

OK.

> AFAIK, the CSS selector still differs so on the output side they are not
> alike.  I.e. the former is "figure>img" the other is a "p>img".  Aside: If
> anything, removing the "p" tag inside the figure would make it easier to
> handle images.

So would the following patch fix the issue?

Regards,

-- 
Nicolas Goaziou
>From 49ebd5a8406bdee0c0a94b83f7135d94e35bb6ba Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <m...@nicolasgoaziou.fr>
Date: Tue, 24 Jan 2017 22:22:47 +0100
Subject: [PATCH] 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.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index d3c1b2eb1..fa8476a05 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1607,7 +1607,7 @@ arguments CAPTION and LABEL are given, use them for caption and
 	    ;; ID.
 	    (if (org-string-nw-p label) (format " id=\"%s\"" label) "")
 	    ;; Contents.
-	    (format "\n<p>%s</p>" contents)
+	    (if html5-fancy contents (format "\n<p>%s</p>" contents))
 	    ;; Caption.
 	    (if (not (org-string-nw-p caption)) ""
 	      (format (if html5-fancy "\n<figcaption>%s</figcaption>"
-- 
2.11.0

Reply via email to