aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph C. Sible <josephcsible@users.noreply.github.com>2020-03-29 01:48:47 -0400
committerGitHub <noreply@github.com>2020-03-28 22:48:47 -0700
commit7233a7a9329c6c4e75f84b9dca01cb05bf2a55b7 (patch)
tree0731f09d09185fe263570019b9694f952342446e /src
parentc812ff7e897fcc43448b26e5ce53480eeb5a81f9 (diff)
downloadpandoc-7233a7a9329c6c4e75f84b9dca01cb05bf2a55b7.tar.gz
More cleanup (#6209)
* Simplify by collapsing a do block into a single <$> * Remove an unnecessary variable: `all` takes any Foldable, so only blocksToInlines needs toList.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs7
1 files changed, 3 insertions, 4 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