On 25/11/2021 00:00, Max Nikulin wrote:
On 24/11/2021 22:59, Matt Huszagh wrote:
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?
Of course, another attributes may be there.
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.
I am confused. I can not figure out how to create the following as HTML
export result:
<img src="img.png" alt="An image without :width 600 attribute">
Attempt to add quotes leads to " and does not prevent ":width" to
become another attribute.
#+attr_html: :alt An image without :width 600 attribute
[[file:img.png]]
<p><img src="img.png" alt="An image without" width="600 attribute" />
</p>
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.