aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-11-07 10:52:11 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-11-07 10:53:07 -0800
commit08ce3addde2f1cfa3d5d285225119c459e4786de (patch)
tree5621816ad80c7ee1e88f22170bfd2cee4535d6c6 /src/Text
parent527346cc7e2bc874092be2f6793001860e10a719 (diff)
downloadpandoc-08ce3addde2f1cfa3d5d285225119c459e4786de.tar.gz
Hlint suggestions.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/DokuWiki.hs5
1 files changed, 3 insertions, 2 deletions
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 $ "<code" <>
(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") <> "</code>\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")