|
From: | Max Nikulin |
Subject: | Re: [PATCH] Fix regex for determining image width from attribute |
Date: | Mon, 29 Nov 2021 19:15:27 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 29/11/2021 07:23, Matt Huszagh wrote:
Max Nikulin writes:My current variant: ":\\(?:[^\n]*?[[:blank:]]\\)?:width[[:blank:]]+\\(\\S-+\\)" The regexp should not match e.g. #+attr_html: :alt something :width 600 P.S. I would prefer to use the same parser as ox does.I can probably implement this if people want. But, let me know if I should indeed use org-export-registered-backends. However, I'm starting to feel like this should be separate patch (the goal for mine was just to prioritize attr_org).
I am against regexps that have obvious flaws. I admit however that the regexp that appeared long time ago before your patch fails for some corner cases as well.
I will left decision to you and to Org developers and maintainers.Additionally, I like that Timothy transformed a code fragment into `org-display-inline-image--width' function and, I suppose, it deserves some unit tests (see testing/README file).
[Prev in Thread] | Current Thread | [Next in Thread] |