From 0529562b428d421f8aaf398bc604bc8d2f9498e8 Mon Sep 17 00:00:00 2001 From: Nick Dokos Date: Thu, 9 Jan 2014 15:38:28 -0500 Subject: [PATCH] Use tags instead of --- lisp/ox-html.el | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 7dbbfc8..b57c97d 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1317,9 +1317,11 @@ CSS classes, then this prefix can be very useful." (let ((dt (downcase (plist-get info :html-doctype)))) (member dt '("html5" "xhtml5" "")))) -(defun org-html-close-tag (tag attr info) +(defun org-html-close-tag (tag attr info &optional longopt) (concat "<" tag " " attr - (if (org-html-xhtml-p info) " />" ">"))) + (if (not longopt) + (if (org-html-xhtml-p info) " />" ">") + (concat "> ")))) (defun org-html-doctype (info) "Return correct html doctype tag from `org-html-doctype-alist', @@ -1362,6 +1364,12 @@ arguments CAPTION and LABEL are given, use them for caption and "\n

%s

") caption))))) +(defun org-html-image-type (source info) + (let ((suffix (file-name-extension source))) + (if (string= suffix "svg") + "svg+xml" + suffix))) + (defun org-html--format-image (source attributes info) "Return \"img\" tag with given SOURCE and ATTRIBUTES. SOURCE is a string specifying the location of the image. @@ -1369,16 +1377,18 @@ ATTRIBUTES is a plist, as returned by `org-export-read-attribute'. INFO is a plist used as a communication channel." (org-html-close-tag - "img" + "object" (org-html--make-attribute-string (org-combine-plists - (list :src source - :alt (if (string-match-p "^ltxpng/" source) - (org-html-encode-plain-text - (org-find-text-property-in-string 'org-latex-src source)) - (file-name-nondirectory source))) + (list :data source + :type (concat "image/" (org-html-image-type source info)) + ;; :alt (if (string-match-p "^ltxpng/" source) + ;; (org-html-encode-plain-text + ;; (org-find-text-property-in-string 'org-latex-src source)) + ;; (file-name-nondirectory source)) + ) attributes)) - info)) + info t)) (defun org-html--textarea-block (element) "Transcode ELEMENT into a textarea block. -- 1.8.5.rc0