git.iko.soy/typeable/pandoc
on master help sign in
More cleanup (#6209)
7233a7aJoseph C. Sible
src/Text/Pandoc/Readers/Docx.hs+3−4
@@ -334,15 +334,14 @@ extentToAttr _ = nullAttr
334
334
335blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines
335blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines
336blocksToInlinesWarn cmtId blks = do
336blocksToInlinesWarn cmtId blks = do
337− let blkList = toList blks
338− paraOrPlain :: Block -> Bool
337+ let paraOrPlain :: Block -> Bool
339 paraOrPlain (Para _) = True
338 paraOrPlain (Para _) = True
340 paraOrPlain (Plain _) = True
339 paraOrPlain (Plain _) = True
341 paraOrPlain _ = False
340 paraOrPlain _ = False
342− unless (all paraOrPlain blkList) $
341+ unless (all paraOrPlain blks) $
343 lift $ P.report $ DocxParserWarning $
342 lift $ P.report $ DocxParserWarning $
344 "Docx comment " <> cmtId <> " will not retain formatting"
343 "Docx comment " <> cmtId <> " will not retain formatting"
345− return $ blocksToInlines' blkList
344+ return $ blocksToInlines' (toList blks)
346
345
347-- The majority of work in this function is done in the primed
346-- The majority of work in this function is done in the primed
348-- subfunction `partPartToInlines'`. We make this wrapper so that we
347-- subfunction `partPartToInlines'`. We make this wrapper so that we
test/Tests/Readers/Docx.hs+2−3
@@ -90,9 +90,8 @@ testForWarningsWithOpts opts name docxFile expected =
90-- testForWarnings = testForWarningsWithOpts defopts
90-- testForWarnings = testForWarningsWithOpts defopts
91
91
92getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
92getMedia :: FilePath -> FilePath -> IO (Maybe B.ByteString)
93−getMedia archivePath mediaPath = do
93+getMedia archivePath mediaPath = fmap fromEntry . findEntryByPath
94− zf <- toArchive <$> B.readFile archivePath
94+ ("word/" ++ mediaPath) . toArchive <$> B.readFile archivePath
95− return $ fromEntry <$> findEntryByPath ("word/" ++ mediaPath) zf
96
95
97compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
96compareMediaPathIO :: FilePath -> MediaBag -> FilePath -> IO Bool
98compareMediaPathIO mediaPath mediaBag docxPath = do
97compareMediaPathIO mediaPath mediaBag docxPath = do