From d4f684b24872e4c0bfbaea0526f6f773cd2d8281 Mon Sep 17 00:00:00 2001 From: Niklas Fasching Date: Tue, 20 Aug 2024 14:56:47 +0200 Subject: [PATCH] Update image extension regex to match emacs image-file-name-extensions See #117 --- org/inline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org/inline.go b/org/inline.go index e2587d0..dbd20c6 100644 --- a/org/inline.go +++ b/org/inline.go @@ -65,7 +65,7 @@ type Macro struct { var validURLCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=" var autolinkProtocols = regexp.MustCompile(`^(https?|ftp|file)$`) -var imageExtensionRegexp = regexp.MustCompile(`(?i)^[.](png|gif|jpe?g|svg|tiff?)$`) +var imageExtensionRegexp = regexp.MustCompile(`(?i)^[.](png|gif|jpe?g|svg|tiff?|webp|x[bp]m|p[bgpn]m)$`) var videoExtensionRegexp = regexp.MustCompile(`(?i)^[.](webm|mp4)$`) var subScriptSuperScriptRegexp = regexp.MustCompile(`^([_^]){([^{}]+?)}`)