diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-11-07 10:52:11 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-11-07 10:53:07 -0800 |
commit | 08ce3addde2f1cfa3d5d285225119c459e4786de (patch) | |
tree | 5621816ad80c7ee1e88f22170bfd2cee4535d6c6 /src/Text/Pandoc/Writers | |
parent | 527346cc7e2bc874092be2f6793001860e10a719 (diff) | |
download | pandoc-08ce3addde2f1cfa3d5d285225119c459e4786de.tar.gz |
Hlint suggestions.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 5 |
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") |