Browse Source

org.el (org-display-inline-images): Search for #+ATTR within the current paragraph

* org.el (org-display-inline-images): Search for #+ATTR within
the current paragraph.
Bastien Guerry 12 years ago
parent
commit
570083d2ad
1 changed files with 5 additions and 3 deletions
  1. 5 3
      lisp/org.el

+ 5 - 3
lisp/org.el

@@ -17961,9 +17961,11 @@ BEG and END default to the buffer boundaries."
 				    (null org-image-actual-width))
 				(save-excursion
 				  (save-match-data
-				    (move-beginning-of-line 0)
-				    (if (looking-at "#\\+ATTR.*width=\"\\([^\"]+\\)\"")
-					(string-to-number (match-string 1))))))
+				    (when (re-search-backward
+					   "#\\+ATTR.*width=\"\\([^\"]+\\)\""
+					   (save-excursion
+					     (re-search-backward "^[ \t]*$\\|\\`" nil t)) t)
+				      (string-to-number (match-string 1))))))
 		  width (cond ((eq org-image-actual-width t) nil)
 			      ((null org-image-actual-width) attrwidth)
 			      ((numberp org-image-actual-width)