git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #1601 from jkr/windowsfix
fe6d43bJohn MacFarlane
src/Text/Pandoc/Readers/Docx/Parse.hs+1−1
@@ -584,7 +584,7 @@ expandDrawingId s = do
584 target <- asks (lookupRelationship s . envRelationships)
584 target <- asks (lookupRelationship s . envRelationships)
585 case target of
585 case target of
586 Just filepath -> do
586 Just filepath -> do
587− bytes <- asks (lookup (combine "word" filepath) . envMedia)
587+ bytes <- asks (lookup ("word/" ++ filepath) . envMedia)
588 case bytes of
588 case bytes of
589 Just bs -> return (filepath, bs)
589 Just bs -> return (filepath, bs)
590 Nothing -> throwError DocxError
590 Nothing -> throwError DocxError
tests/Tests/Readers/Docx.hs+1−2
@@ -13,7 +13,6 @@ import Text.Pandoc.Writers.Native (writeNative)
13import qualified Data.Map as M
13import qualified Data.Map as M
14import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory)
14import Text.Pandoc.MediaBag (MediaBag, lookupMedia, mediaDirectory)
15import Codec.Archive.Zip
15import Codec.Archive.Zip
16−import System.FilePath (combine)
17
16
18-- We define a wrapper around pandoc that doesn't normalize in the
17-- We define a wrapper around pandoc that doesn't normalize in the
19-- tests. Since we do our own normalization, we want to make sure
18-- tests. Since we do our own normalization, we want to make sure
@@ -60,7 +59,7 @@ testCompare = testCompareWithOpts def
60getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
59getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
61getMedia archivePath mediaPath = do
60getMedia archivePath mediaPath = do
62 zf <- B.readFile archivePath >>= return . toArchive
61 zf <- B.readFile archivePath >>= return . toArchive
63− return $ findEntryByPath (combine "word" mediaPath) zf >>= (Just . fromEntry)
62+ return $ findEntryByPath ("word/" ++ mediaPath) zf >>= (Just . fromEntry)
64
63
65compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
64compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
66compareMediaPathIO mediaPath mediaBag docxPath = do
65compareMediaPathIO mediaPath mediaBag docxPath = do