Markdown writer: proper handling of block quotes in lhs mode.

If in lhs mode, put space before bird tracks for block quotes,
to prevent them from being interpreted as literate Haskell
source.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1502 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2008-12-02 22:42:38 +00:00
parent 430e55c0f1
commit 9aecc17c1d

View file

@ -191,8 +191,13 @@ blockToMarkdown opts (CodeBlock (_,classes,_) str) | "haskell" `elem` classes &&
blockToMarkdown opts (CodeBlock _ str) = return $
(nest (writerTabStop opts) $ vcat $ map text (lines str)) <> text "\n"
blockToMarkdown opts (BlockQuote blocks) = do
-- if we're writing literate haskell, put a space before the bird tracks
-- so they won't be interpreted as lhs...
let leader = if writerLiterateHaskell opts
then text . (" > " ++)
else text . ("> " ++)
contents <- blockListToMarkdown opts blocks
return $ (vcat $ map (text . ("> " ++)) $ lines $ render contents) <>
return $ (vcat $ map leader $ lines $ render contents) <>
text "\n"
blockToMarkdown opts (Table caption aligns widths headers rows) = do
caption' <- inlineListToMarkdown opts caption