git.iko.soy/typeable/pandoc
on master help sign in
Text.Pandoc.Class.writeMedia: unescape URI-escaping in file path.

This avoids writing things like `file%20one.png` to the file system.

commitb15f4f468dd9d50c60eeea982048730200a2858b authorJohn MacFarlane <jgm@berkeley.edu> dateThu 19 Apr 2018, 11:39 (9 years ago) parentb87dd19
1 file changed+1−1
src/Text/Pandoc/Class.hs+1−1
src/Text/Pandoc/Class.hs+1−1
@@ -855,7 +855,7 @@ writeMedia :: FilePath -> MediaBag -> FilePath -> PandocIO ()
855855writeMedia dir mediabag subpath = do
856856 -- we join and split to convert a/b/c to a\b\c on Windows;
857857 -- in zip containers all paths use /
858− let fullpath = dir </> normalise subpath
858+ let fullpath = dir </> unEscapeString (normalise subpath)
859859 let mbcontents = lookupMedia subpath mediabag
860860 case mbcontents of
861861 Nothing -> throwError $ PandocResourceNotFound subpath