>From d0150b8c34efb1086dd5b240b256b0cf1f053148 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen
Date: Tue, 18 Aug 2015 08:42:35 +0800 Subject: [PATCH] Add function to better guard html5 exports * lisp/ox-html.el (org-html-html5-fancy-p): New function. Check that we're exporting to HTML5, *and* that the user has requested fancy elements. (org-html--wrap-image, org-html-template, org-html-toc) (org-html-special-block): Use new function. --- lisp/ox-html.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index bdcdeee..78c8e11 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1473,6 +1473,10 @@ CSS classes, then this prefix can be very useful." (let ((dt (downcase (plist-get info :html-doctype)))) (member dt '("html5" "xhtml5" "")))) +(defun org-html-html5-fancy-p (info) + (and (plist-get info :html-html5-fancy) + (org-html-html5-p info))) + (defun org-html-close-tag (tag attr info) (concat "<" tag " " attr (if (org-html-xhtml-p info) " />" ">"))) @@ -1503,8 +1507,7 @@ attributes with a nil value will be omitted from the result." 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 (and (org-html-html5-p info) - (plist-get info :html-html5-fancy)))) + (let ((html5-fancy (org-html-html5-fancy-p info))) (format (if html5-fancy "\n%s
\n" "\n