浏览代码

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.
Bastien Guerry 12 年之前
父节点
当前提交
55f4f92183
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      lisp/org-html.el

+ 4 - 1
lisp/org-html.el

@@ -1030,7 +1030,10 @@ OPT-PLIST is the export options list."
 	  (if (string-match "^file:" desc)
 	  (if (string-match "^file:" desc)
 	      (setq desc (substring desc (match-end 0)))))
 	      (setq desc (substring desc (match-end 0)))))
 	(setq desc (org-add-props
 	(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) "\"/>")
 			       (file-name-nondirectory desc) "\"/>")
 		       '(org-protected t))))
 		       '(org-protected t))))
       (cond
       (cond