From cae155b095e5182cc1b342b21f7430e40afe7ba8 Mon Sep 17 00:00:00 2001 From: Christian Despres <50160106+despresc@users.noreply.github.com> Date: Sun, 13 Sep 2020 10:48:14 -0400 Subject: Fix hlint suggestions, update hlint.yaml (#6680) * Fix hlint suggestions, update hlint.yaml Most suggestions were redundant brackets. Some required LambdaCase. The .hlint.yaml file had a small typo, and didn't ignore camelCase suggestions in certain modules. --- src/Text/Pandoc/Readers/JATS.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc/Readers/JATS.hs') diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs index d3d742de3..69d597212 100644 --- a/src/Text/Pandoc/Readers/JATS.hs +++ b/src/Text/Pandoc/Readers/JATS.hs @@ -189,7 +189,7 @@ parseBlock (Elem e) = _ -> getBlocks e where parseMixed container conts = do let (ils,rest) = break isBlockElement conts - ils' <- (trimInlines . mconcat) <$> mapM parseInline ils + ils' <- trimInlines . mconcat <$> mapM parseInline ils let p = if ils' == mempty then mempty else container ils' case rest of [] -> return p @@ -206,7 +206,7 @@ parseBlock (Elem e) = parseBlockquote = do attrib <- case filterChild (named "attribution") e of Nothing -> return mempty - Just z -> (para . (str "— " <>) . mconcat) + Just z -> para . (str "— " <>) . mconcat <$> mapM parseInline (elContent z) contents <- getBlocks e @@ -281,7 +281,7 @@ parseBlock (Elem e) = in ColWidth . (/ tot) <$> ws' Nothing -> replicate numrows ColWidthDefault let toRow = Row nullAttr . map simpleCell - toHeaderRow l = if null l then [] else [toRow l] + toHeaderRow l = [toRow l | not (null l)] return $ table (simpleCaption $ plain capt) (zip aligns widths) (TableHead nullAttr $ toHeaderRow headrows) @@ -309,7 +309,7 @@ parseBlock (Elem e) = return $ headerWith (ident,[],[]) n' headerText <> b getInlines :: PandocMonad m => Element -> JATS m Inlines -getInlines e' = (trimInlines . mconcat) <$> +getInlines e' = trimInlines . mconcat <$> mapM parseInline (elContent e') parseMetadata :: PandocMonad m => Element -> JATS m Blocks @@ -518,10 +518,10 @@ parseInline (Elem e) = "email" -> return $ link ("mailto:" <> textContent e) "" $ str $ textContent e "uri" -> return $ link (textContent e) "" $ str $ textContent e - "fn" -> (note . mconcat) <$> + "fn" -> note . mconcat <$> mapM parseBlock (elContent e) _ -> innerInlines - where innerInlines = (trimInlines . mconcat) <$> + where innerInlines = trimInlines . mconcat <$> mapM parseInline (elContent e) mathML x = case readMathML . T.pack . showElement $ everywhere (mkT removePrefix) x of -- cgit v1.2.3