org-html.el (org-html-handle-links): Fix bug in setting the attribute for link with...
authorBastien Guerry <bzg@altern.org>
Thu, 31 Jan 2013 09:25:03 +0000 (31 10:25 +0100)
committerBastien Guerry <bzg@altern.org>
Thu, 31 Jan 2013 09:25:03 +0000 (31 10:25 +0100)
* 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.

lisp/org-html.el

index 493d8a2..8cada8f 100644 (file)
@@ -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