Hi,

A recent patch started computing the inline image width from any attr_
line. This is incorrect, as it matches settings like attr_latex, or
attr_html. We only want to look for settings specifically for the org
buffer. This patch fixes that.

Thanks
Matt

>From b9b8fb9b31dbb9145c2fe73af04eccd59f7a9973 Mon Sep 17 00:00:00 2001
From: Matt Huszagh <huszaghm...@gmail.com>
Date: Sun, 21 Nov 2021 11:02:37 -0800
Subject: [PATCH] lisp/org.el: Fix regex for determining image width from
 attribute

	* lisp/org.el (org-display-inline-image--width): The regex
	should only match attr_org, not any attr_.  This would match
	attributes set for all export backends, such as latex and
	HTML, which is incorrect.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index eeefb4af3..92e765373 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16853,7 +16853,7 @@ buffer boundaries with possible narrowing."
    ((listp org-image-actual-width)
     (let* ((case-fold-search t)
            (par (org-element-lineage link '(paragraph)))
-           (attr-re "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)")
+           (attr-re "^[ \t]*#\\+attr_org: +.*?:width +\\(\\S-+\\)")
            (par-end (org-element-property :post-affiliated par))
            ;; Try to find an attribute providing a :width.
            (attr-width
-- 
2.31.1

Reply via email to