diff options
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") |