aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs7
-rw-r--r--test/Tests/Readers/Docx.hs5
2 files changed, 5 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index e1a8066ba..ac35fa91e 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -334,15 +334,14 @@ extentToAttr _ = nullAttr
blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines
blocksToInlinesWarn cmtId blks = do
- let blkList = toList blks
- paraOrPlain :: Block -> Bool
+ let paraOrPlain :: Block -> Bool
paraOrPlain (Para _) = True
paraOrPlain (Plain _) = True
paraOrPlain _ = False
- unless (all paraOrPlain blkList) $
+ unless (all paraOrPlain blks) $
lift $ P.report $ DocxParserWarning $
"Docx comment " <> cmtId <> " will not retain formatting"
- return $ blocksToInlines' blkList
+ return $ blocksToInlines' (toList blks)
-- The majority of work in this function is done in the primed
-- subfunction `partPartToInlines'`. We make this wrapper so that we
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs
index 3caaa1316..456e0affe 100644
--- a/test/Tests/Readers/Docx.hs
+++ b/test/Tests/Readers/Docx.hs
@@ -90,9 +90,8 @@ testForWarningsWithOpts opts name docxFile expected =
-- testForWarnings = testForWarningsWithOpts defopts
getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
-getMedia archivePath mediaPath = do
- zf <- toArchive <$> B.readFile archivePath
- return $ fromEntry <$> findEntryByPath ("word/" ++ mediaPath) zf
+getMedia archivePath mediaPath = fmap fromEntry . findEntryByPath
+ ("word/" ++ mediaPath) . toArchive <$> B.readFile archivePath
compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
compareMediaPathIO mediaPath mediaBag docxPath = do