diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-09-27 16:21:17 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-09-27 16:21:17 -0700 |
commit | fe6d43b3e0c3d7c9f4742873e33e54237f4efe9f (patch) | |
tree | 633d2867ff088e5811d652a208fb03ddb534efce | |
parent | 9c4e33f085c40a4cbf221c5b76830fcf062880a2 (diff) | |
parent | a6eead7f261ed47269e7f7e45b5774d8620e602b (diff) | |
download | pandoc-fe6d43b3e0c3d7c9f4742873e33e54237f4efe9f.tar.gz |
Merge pull request #1601 from jkr/windowsfix
Fix path-slashes inside archive for windows
-rw-r--r-- | src/Text/Pandoc/Readers/Docx/Parse.hs | 2 | ||||
-rw-r--r-- | tests/Tests/Readers/Docx.hs | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index e7a6c3ffb..2945a1eda 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -584,7 +584,7 @@ expandDrawingId s = do target <- asks (lookupRelationship s . envRelationships) case target of Just filepath -> do - bytes <- asks (lookup (combine "word" filepath) . envMedia) + bytes <- asks (lookup ("word/" ++ filepath) . envMedia) case bytes of Just bs -> return (filepath, bs) Nothing -> throwError DocxError diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index 565d117e9..584e7cc94 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -13,7 +13,6 @@ import Text.Pandoc.Writers.Native (writeNative) import qualified Data.Map as M import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory) import Codec.Archive.Zip -import System.FilePath (combine) -- We define a wrapper around pandoc that doesn't normalize in the -- tests. Since we do our own normalization, we want to make sure @@ -60,7 +59,7 @@ testCompare = testCompareWithOpts def getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString) getMedia archivePath mediaPath = do zf <- B.readFile archivePath >>= return . toArchive - return $ findEntryByPath (combine "word" mediaPath) zf >>= (Just . fromEntry) + return $ findEntryByPath ("word/" ++ mediaPath) zf >>= (Just . fromEntry) compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool compareMediaPathIO mediaPath mediaBag docxPath = do |