Use regexp-opt

This commit is contained in:
Masanao Igarashi
2025-04-07 16:46:21 +09:00
parent b4ba5c7e95
commit 31999a9114

View File

@@ -171,9 +171,9 @@ When nil, an anchor with reference is used to link to the image."
:type 'boolean)
(defcustom org-rst-inline-image-rules
'(("file" . "\\.\\(jpeg\\|jpg\\|png\\|webp\\|gif\\|svg\\|svgz\\|swf\\)\\'")
("http" . "\\.\\(jpeg\\|jpg\\|png\\|webp\\|gif\\|svg\\|svgz\\|swf\\)\\'")
("https" . "\\.\\(jpeg\\|jpg\\|png\\|webp\\|gif\\|svg\\|svgz\\|swf\\)\\'"))
`(("file" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".svgz" ".webp" ".avif")))
("http" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".svgz" ".webp" ".avif")))
("https" . ,(regexp-opt '(".jpeg" ".jpg" ".png" ".gif" ".svg" ".svgz" ".webp" ".avif"))))
"Rules characterizing image files that can be inlined into reStructuredText.
A rule consists in an association whose key is the type of link
to consider, and value is a regexp that will be matched against