From 8d6fac1253b26dfbbf7b82c717f3933588ed98b9 Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Mon, 3 Feb 2020 11:14:22 -0500 Subject: 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. --- src/Text/Pandoc/Readers/Docx.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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 -- cgit v1.2.3