git.iko.soy/typeable/pandoc
on master help sign in
Hlint suggestions.
commit08ce3addde2f1cfa3d5d285225119c459e4786de authorJohn MacFarlane <jgm@berkeley.edu> dateSat 7 Nov 2020, 10:52 (6 years ago) parent527346c
1 file changed+3−2
src/Text/Pandoc/Writers/DokuWiki.hs+3−2
src/Text/Pandoc/Writers/DokuWiki.hs+3−2
@@ -39,6 +39,7 @@ import Text.Pandoc.Shared (camelCaseToHyphenated, escapeURI, isURI, linesToPara,
3939import Text.Pandoc.Templates (renderTemplate)
4040import Text.DocLayout (render, literal)
4141import Text.Pandoc.Writers.Shared (defField, metaToContext, toLegacyTable)
42+import Data.Maybe (fromMaybe)
4243import qualified Data.Map as M
4344
4445data WriterState = WriterState {
@@ -150,7 +151,7 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) =
150151 return $ "<code" <>
151152 (case classes of
152153 [] -> ""
153− (x:_) -> " " <> maybe x id (M.lookup x languageNames)) <>
154+ (x:_) -> " " <> fromMaybe x (M.lookup x languageNames)) <>
154155 ">\n" <> str <>
155156 (if "\n" `T.isSuffixOf` str then "" else "\n") <> "</code>\n"
156157
@@ -503,7 +504,7 @@ imageDims opts attr = go (toPx $ dimension Width attr) (toPx $ dimension Height
503504 go Nothing Nothing = ""
504505
505506languageNames :: M.Map Text Text
506−languageNames = M.fromList $
507+languageNames = M.fromList
507508 [("cs", "csharp")
508509 ,("coffee", "cofeescript")
509510 ,("commonlisp", "lisp")