0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-15 20:46:27 +00:00

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>
This commit is contained in:
Nicolas Goaziou 2017-01-24 22:22:47 +01:00
parent c77b658b39
commit b6b1e35f33

View file

@ -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 arguments CAPTION and LABEL are given, use them for caption and
\"id\" attribute." \"id\" attribute."
(let ((html5-fancy (org-html--html5-fancy-p info))) (let ((html5-fancy (org-html--html5-fancy-p info)))
(format (if html5-fancy "\n<figure%s>%s%s\n</figure>" (format (if html5-fancy "\n<figure%s>\n%s%s\n</figure>"
"\n<div%s class=\"figure\">%s%s\n</div>") "\n<div%s class=\"figure\">\n%s%s\n</div>")
;; ID. ;; ID.
(if (org-string-nw-p label) (format " id=\"%s\"" label) "") (if (org-string-nw-p label) (format " id=\"%s\"" label) "")
;; Contents. ;; Contents.
(format "\n<p>%s</p>" contents) (if html5-fancy contents (format "<p>%s</p>" contents))
;; Caption. ;; Caption.
(if (not (org-string-nw-p caption)) "" (if (not (org-string-nw-p caption)) ""
(format (if html5-fancy "\n<figcaption>%s</figcaption>" (format (if html5-fancy "\n<figcaption>%s</figcaption>"