From f2da7933a28c7dbe86ec79908b6371d910c214e6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 4 Aug 2025 09:51:17 -0700 Subject: Do not drop fragment/hash for local file paths. With the previous behavior it was impossible to have an image file containing `#` or `?`. For the motivation for the previous behavior, see commit 1d137fb. Closes #11021. --- src/Text/Pandoc/Class/PandocMonad.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs index e106c23e1..618b27c79 100644 --- a/src/Text/Pandoc/Class/PandocMonad.hs +++ b/src/Text/Pandoc/Class/PandocMonad.hs @@ -408,8 +408,7 @@ downloadOrRead s uriPath = "", uriQuery = "", uriFragment = "" } - dropFragmentAndQuery = T.takeWhile (\c -> c /= '?' && c /= '#') - fp = unEscapeString $ T.unpack $ dropFragmentAndQuery s + fp = unEscapeString $ T.unpack s mime = getMimeType $ case takeExtension fp of ".gz" -> dropExtension fp ".svgz" -> dropExtension fp ++ ".svg" -- cgit v1.2.3