diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 89acd2ef5..78b8fcd73 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -177,7 +177,12 @@ blockToRST (CodeBlock (_,classes,_) str) = do if "haskell" `elem` classes && "literate" `elem` classes && isEnabled Ext_literate_haskell opts then return $ prefixed "> " (text str) $$ blankline - else return $ "::" $+$ nest tabstop (text str) $$ blankline + else return $ + (case [c | c <- classes, + c `notElem` ["sourceCode","literate","numberLines"]] of + [] -> "::" + (lang:_) -> ".. code:: " <> text lang) + $+$ nest tabstop (text str) $$ blankline blockToRST (BlockQuote blocks) = do tabstop <- get >>= (return . writerTabStop . stOptions) contents <- blockListToRST blocks |