diff options
| author | John MacFarlane <[email protected]> | 2025-08-04 09:51:17 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-08-04 09:53:10 -0700 |
| commit | f2da7933a28c7dbe86ec79908b6371d910c214e6 (patch) | |
| tree | f71bc5ea7f6c4a1d7a9a5f8a5df8d6297eef81a3 | |
| parent | b75c537d87d66a51acb129f5704a77e5cd59f847 (diff) | |
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.
| -rw-r--r-- | src/Text/Pandoc/Class/PandocMonad.hs | 3 |
1 files changed, 1 insertions, 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" |
