git.iko.soy/typeable/pandoc
on master help sign in
Handle Word files generated by Microsoft Word Online.
2b003d4John MacFarlane
src/Text/Pandoc/Readers/Docx/Parse.hs+2
@@ -364,6 +364,7 @@ archiveToDocxWithWarnings archive = do
364archiveToDocument :: Archive -> D Document
364archiveToDocument :: Archive -> D Document
365archiveToDocument zf = do
365archiveToDocument zf = do
366 entry <- maybeToD $ findEntryByPath "word/document.xml" zf
366 entry <- maybeToD $ findEntryByPath "word/document.xml" zf
367+ `mplus` findEntryByPath "word/document2.xml" zf -- see #5277
367 docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry
368 docElem <- maybeToD $ (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry
368 let namespaces = elemToNameSpaces docElem
369 let namespaces = elemToNameSpaces docElem
369 bodyElem <- maybeToD $ findChildByName namespaces "w" "body" docElem
370 bodyElem <- maybeToD $ findChildByName namespaces "w" "body" docElem
@@ -478,6 +479,7 @@ archiveToComments zf =
478
479
479filePathToRelType :: FilePath -> Maybe DocumentLocation
480filePathToRelType :: FilePath -> Maybe DocumentLocation
480filePathToRelType "word/_rels/document.xml.rels" = Just InDocument
481filePathToRelType "word/_rels/document.xml.rels" = Just InDocument
482+filePathToRelType "word/_rels/document2.xml.rels" = Just InDocument
481filePathToRelType "word/_rels/footnotes.xml.rels" = Just InFootnote
483filePathToRelType "word/_rels/footnotes.xml.rels" = Just InFootnote
482filePathToRelType "word/_rels/endnotes.xml.rels" = Just InEndnote
484filePathToRelType "word/_rels/endnotes.xml.rels" = Just InEndnote
483filePathToRelType _ = Nothing
485filePathToRelType _ = Nothing