From b15f4f468dd9d50c60eeea982048730200a2858b Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Thu, 19 Apr 2018 11:39:35 -0700 Subject: Text.Pandoc.Class.writeMedia: unescape URI-escaping in file path. This avoids writing things like `file%20one.png` to the file system. --- src/Text/Pandoc/Class.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index c78822ee9..3529054e6 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -855,7 +855,7 @@ writeMedia :: FilePath -> MediaBag -> FilePath -> PandocIO () writeMedia dir mediabag subpath = do -- we join and split to convert a/b/c to a\b\c on Windows; -- in zip containers all paths use / - let fullpath = dir </> normalise subpath + let fullpath = dir </> unEscapeString (normalise subpath) let mbcontents = lookupMedia subpath mediabag case mbcontents of Nothing -> throwError $ PandocResourceNotFound subpath -- cgit v1.2.3