aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-22 23:21:57 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-22 23:21:57 -0700
commit2956ef251c815c332679ff4666031a5b7a65aadc (patch)
treebfe56291d20fedc2f26489feb2c43057c26efbfd /src/Text/Pandoc/Shared.hs
parent17f71002ae099fe1bbd4ffda4a979bb6c5bab9e1 (diff)
downloadpandoc-2956ef251c815c332679ff4666031a5b7a65aadc.tar.gz
Fixed --self-contained with Windows paths.
Previously C:\foo.js was being wrongly interpreted as a URI. Closes #1558.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 3adf2a1f6..1f89224ff 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -796,7 +796,8 @@ fetchItem sourceURL s =
mime = case takeExtension fp of
".gz" -> getMimeType $ dropExtension fp
x -> getMimeType x
- ensureEscaped = escapeURIString isAllowedInURI
+ ensureEscaped x@(_:':':'\\':_) = x -- likely windows path
+ ensureEscaped x = escapeURIString isAllowedInURI x
-- | Like 'fetchItem', but also looks for items in a 'MediaBag'.
fetchItem' :: MediaBag -> Maybe String -> String