From 08ce3addde2f1cfa3d5d285225119c459e4786de Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 7 Nov 2020 10:52:11 -0800 Subject: Hlint suggestions. --- src/Text/Pandoc/Writers/DokuWiki.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 0679ac6c7..90ec6824f 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -39,6 +39,7 @@ import Text.Pandoc.Shared (camelCaseToHyphenated, escapeURI, isURI, linesToPara, import Text.Pandoc.Templates (renderTemplate) import Text.DocLayout (render, literal) import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable) +import Data.Maybe (fromMaybe) import qualified Data.Map as M data WriterState = WriterState { @@ -150,7 +151,7 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = return $ " (case classes of [] -> "" - (x:_) -> " " <> maybe x id (M.lookup x languageNames)) <> + (x:_) -> " " <> fromMaybe x (M.lookup x languageNames)) <> ">\n" <> str <> (if "\n" `T.isSuffixOf` str then "" else "\n") <> "\n" @@ -503,7 +504,7 @@ imageDims opts attr = go (toPx $ dimension Width attr) (toPx $ dimension Height go Nothing Nothing = "" languageNames :: M.Map Text Text -languageNames = M.fromList $ +languageNames = M.fromList [("cs", "csharp") ,("coffee", "cofeescript") ,("commonlisp", "lisp") -- cgit v1.2.3