summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-01-31 10:25:03 +0100
committerBastien Guerry <bzg@altern.org>2013-01-31 10:25:03 +0100
commit55f4f921835bbf5d7b8e9dd82fe8dcfef2fac4e2 (patch)
tree4f39deae751c50cb70fa644f9325c83f56f787b7
parentebad7d9226c38e6c3886b00cee6233f69ffd6c78 (diff)
downloadorg-mode-55f4f921835bbf5d7b8e9dd82fe8dcfef2fac4e2.tar.gz
org-html.el (org-html-handle-links): Fix bug in setting the attribute for link with images
* org-html.el (org-html-handle-links): When the link description is an image and the attribute is "width", pass the attribute to the <img ...> tag. Thanks to John Hendy for reporting this.
-rw-r--r--lisp/org-html.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 493d8a2..8cada8f 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1030,7 +1030,10 @@ OPT-PLIST is the export options list."
(if (string-match "^file:" desc)
(setq desc (substring desc (match-end 0)))))
(setq desc (org-add-props
- (concat "<img src=\"" desc "\" alt=\""
+ (concat "<img src=\"" desc "\" "
+ (when (save-match-data (string-match "width=" attr))
+ (prog1 (concat attr " ") (setq attr "")))
+ "alt=\""
(file-name-nondirectory desc) "\"/>")
'(org-protected t))))
(cond