emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix regex for determining image width from attribute


From: Max Nikulin
Subject: Re: [PATCH] Fix regex for determining image width from attribute
Date: Thu, 25 Nov 2021 00:00:04 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 24/11/2021 22:59, Matt Huszagh wrote:

Better?

Certainly. I have not tested the patch though.

I am sorry that I confused you by my note concerning space before :width. I am afraid, current variant means repeated ":"

+                      (concat "^[ \t]*#\\+attr_"
+                              backend
+                              ":+.*? :width +\\(\\S-+\\)")))
                                   ^
-----------------------------------'

Is space after "#+attr_XXX:" is required at all? Is something besides spaces allowed here?

Untested:
":\\s-*:width\\s-+\\(\\S-+\\)"
I am unsure concerning newlines as space characters, so the following, perhaps, is more correct:
":[^\n\\S-]*:width[^\n\\S-]+\\(\\S-+\\)"

Actually value is everything till line end besides trailing spaces, so precise regexp should be a bit longer. Are there backends that allows spaces between number and units?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]