From 1ea5b1802072fe2724977fa859c0e5b48f15917d Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Mon, 3 Feb 2020 23:31:05 -0500 Subject: Swap suboptimal uses of maybe and fromMaybe (#6111) Anywhere "maybe" is used with "id" as its second argument, using "fromMaybe" instead will simplify the code. Conversely, anywhere "fromMaybe" is used with the result of "fmap" or "<$>" as its second argument, using "maybe" instead will simplify the code. --- src/Text/Pandoc/Readers/HTML.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers/HTML.hs') diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 9fd334e62..979bb2de5 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -812,8 +812,8 @@ pSpan = try $ do let isSmallCaps = fontVariant == "small-caps" || "smallcaps" `elem` classes where styleAttr = fromMaybe "" $ lookup "style" attr fontVariant = fromMaybe "" $ pickStyleAttrProps ["font-variant"] styleAttr - classes = fromMaybe [] $ - T.words <$> lookup "class" attr + classes = maybe [] + T.words $ lookup "class" attr let tag = if isSmallCaps then B.smallcaps else B.spanWith (mkAttr attr) return $ tag contents -- cgit v1.2.3