aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph C. Sible <josephcsible@users.noreply.github.com>2020-02-03 11:14:22 -0500
committerGitHub <noreply@github.com>2020-02-03 08:14:22 -0800
commit8d6fac1253b26dfbbf7b82c717f3933588ed98b9 (patch)
treeef83854e20303f6c88c66418928d4c4e520029a1 /src
parentb47a3cdcb6b9ecc302567fa28b05459810e03095 (diff)
downloadpandoc-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')
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs10
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