git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: Fix windows error

Try fixing a parsing error on windows by insisting that the parser use a Posix filepath library for splitting doc paths in a zipfile. (It might default on Windows to using a backslash as a separator, while it's always a forward-slash in zip archives.)

commit2142bbe572cea00b7bb5ad3e10a3afb26845a1f7 authorJesse Rosenthal <jrosenthal@jhu.edu> dateThu 7 Feb 2019, 14:46 (8 years ago) parent4ef2362
1 file changed+2−1
src/Text/Pandoc/Readers/Docx/Parse.hs+2−1
src/Text/Pandoc/Readers/Docx/Parse.hs+2−1
@@ -73,6 +73,7 @@ import Data.List
7373import qualified Data.Map as M
7474import Data.Maybe
7575import System.FilePath
76+import qualified System.FilePath.Posix as PSX
7677import Text.Pandoc.Readers.Docx.Util
7778import Text.Pandoc.Readers.Docx.Fields
7879import Text.Pandoc.Shared (filteredFilesFromArchive, safeRead)
@@ -505,7 +506,7 @@ filePathToRelType "word/_rels/endnotes.xml.rels" _ = Just InEndnote
505506-- -- to see if it's a documentPath, we have to check against the dynamic
506507-- -- docPath specified in "_rels/.rels"
507508filePathToRelType path docXmlPath =
508− if path == "word/_rels/" ++ (takeFileName docXmlPath) ++ ".rels"
509+ if path == "word/_rels/" ++ (PSX.takeFileName docXmlPath) ++ ".rels"
509510 then Just InDocument
510511 else Nothing
511512