aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2019-02-07 14:46:56 -0500
committerJesse Rosenthal <jrosenthal@jhu.edu>2019-02-07 14:46:56 -0500
commit2142bbe572cea00b7bb5ad3e10a3afb26845a1f7 (patch)
tree3c7f6fe2890836f4a8511da4c779317569cc8faf /src/Text/Pandoc/Readers
parent4ef23623d3ef7202eba8e6edf15741657e4cf0c9 (diff)
downloadpandoc-2142bbe572cea00b7bb5ad3e10a3afb26845a1f7.tar.gz
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.)
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
index 3c4791e1a..1153602b3 100644
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -73,6 +73,7 @@ import Data.List
import qualified Data.Map as M
import Data.Maybe
import System.FilePath
+import qualified System.FilePath.Posix as PSX
import Text.Pandoc.Readers.Docx.Util
import Text.Pandoc.Readers.Docx.Fields
import Text.Pandoc.Shared (filteredFilesFromArchive, safeRead)
@@ -505,7 +506,7 @@ filePathToRelType "word/_rels/endnotes.xml.rels" _ = Just InEndnote
-- -- to see if it's a documentPath, we have to check against the dynamic
-- -- docPath specified in "_rels/.rels"
filePathToRelType path docXmlPath =
- if path == "word/_rels/" ++ (takeFileName docXmlPath) ++ ".rels"
+ if path == "word/_rels/" ++ (PSX.takeFileName docXmlPath) ++ ".rels"
then Just InDocument
else Nothing