diff options
author | Joseph C. Sible <josephcsible@users.noreply.github.com> | 2020-02-03 11:14:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 08:14:22 -0800 |
commit | 8d6fac1253b26dfbbf7b82c717f3933588ed98b9 (patch) | |
tree | ef83854e20303f6c88c66418928d4c4e520029a1 /src/Text | |
parent | b47a3cdcb6b9ecc302567fa28b05459810e03095 (diff) | |
download | pandoc-8d6fac1253b26dfbbf7b82c717f3933588ed98b9.tar.gz |
Clean up a confusing triple negative (#6102)
There's currently `unless`, `not`, and `notParaOrPlain` in the same
expression, which is a rather confusing triple negative. Replace
`notParaOrPlain` with `paraOrPlain` and switch to `all` from `any`
to clean this up.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index cd4ff01db..80fd6285c 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -342,11 +342,11 @@ extentToAttr _ = nullAttr blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines blocksToInlinesWarn cmtId blks = do let blkList = toList blks - notParaOrPlain :: Block -> Bool - notParaOrPlain (Para _) = False - notParaOrPlain (Plain _) = False - notParaOrPlain _ = True - unless ( not (any notParaOrPlain blkList)) $ + paraOrPlain :: Block -> Bool + paraOrPlain (Para _) = True + paraOrPlain (Plain _) = True + paraOrPlain _ = False + unless (all paraOrPlain blkList) $ lift $ P.report $ DocxParserWarning $ "Docx comment " <> cmtId <> " will not retain formatting" return $ blocksToInlines' blkList |