git.iko.soy/typeable/pandoc
on master help sign in
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.

commit8d6fac1253b26dfbbf7b82c717f3933588ed98b9 authorJoseph C. Sible <josephcsible@users.noreply.github.com> dateMon 3 Feb 2020, 11:14 (7 years ago) parentb47a3cd
1 file changed+5−5
src/Text/Pandoc/Readers/Docx.hs+5−5
src/Text/Pandoc/Readers/Docx.hs+5−5
@@ -342,11 +342,11 @@ extentToAttr _ = nullAttr
342342blocksToInlinesWarn :: PandocMonad m => T.Text -> Blocks -> DocxContext m Inlines
343343blocksToInlinesWarn cmtId blks = do
344344 let blkList = toList blks
345− notParaOrPlain :: Block -> Bool
346− notParaOrPlain (Para _) = False
347− notParaOrPlain (Plain _) = False
348− notParaOrPlain _ = True
349− unless ( not (any notParaOrPlain blkList)) $
345+ paraOrPlain :: Block -> Bool
346+ paraOrPlain (Para _) = True
347+ paraOrPlain (Plain _) = True
348+ paraOrPlain _ = False
349+ unless (all paraOrPlain blkList) $
350350 lift $ P.report $ DocxParserWarning $
351351 "Docx comment " <> cmtId <> " will not retain formatting"
352352 return $ blocksToInlines' blkList