From 939b1879b389a70407e60dc3b4c17844ffb8a04d Mon Sep 17 00:00:00 2001 From: Fletcher Porter Date: Tue, 14 May 2024 23:30:36 +0300 Subject: [PATCH] Make media file extensions not be case sensitive I had a .PNG file that caused me to spend an hour and a half troubleshooting... --- org/inline.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org/inline.go b/org/inline.go index 03aea45..e2587d0 100644 --- a/org/inline.go +++ b/org/inline.go @@ -65,8 +65,8 @@ type Macro struct { var validURLCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=" var autolinkProtocols = regexp.MustCompile(`^(https?|ftp|file)$`) -var imageExtensionRegexp = regexp.MustCompile(`^[.](png|gif|jpe?g|svg|tiff?)$`) -var videoExtensionRegexp = regexp.MustCompile(`^[.](webm|mp4)$`) +var imageExtensionRegexp = regexp.MustCompile(`(?i)^[.](png|gif|jpe?g|svg|tiff?)$`) +var videoExtensionRegexp = regexp.MustCompile(`(?i)^[.](webm|mp4)$`) var subScriptSuperScriptRegexp = regexp.MustCompile(`^([_^]){([^{}]+?)}`) var timestampRegexp = regexp.MustCompile(`^<(\d{4}-\d{2}-\d{2})( [A-Za-z]+)?( \d{2}:\d{2})?( \+\d+[dwmy])?>`)