@@ -211,13 +211,12 @@ writeMedia :: (PandocMonad m, MonadIO m)
211211 => FilePath -> MediaBag -> FilePath
212212 -> m ()
213213writeMedia dir mediabag subpath = do
214− -- we join and split to convert a/b/c to a\b\c on Windows;
215− -- in zip containers all paths use /
216214 let mbcontents = lookupMedia subpath mediabag
217215 case mbcontents of
218216 Nothing -> throwError $ PandocResourceNotFound $ pack subpath
219217 Just item -> do
220− let fullpath = dir </> mediaPath item
218+ -- we normalize to get proper path separators for the platform
219+ let fullpath = dir </> normalise (mediaPath item)
221220 liftIOError (createDirectoryIfMissing True) (takeDirectory fullpath)
222221 logIOError $ BL.writeFile fullpath $ mediaContents item
223222