diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-12-02 22:42:38 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-12-02 22:42:38 +0000 |
commit | 9aecc17c1d411a4cd5474dfd88968d06111f7811 (patch) | |
tree | b94fc73a87981b168c68c1a310d5969bec72c29c | |
parent | 430e55c0f1ca94fdb20b99061862af2ceabe4469 (diff) | |
download | pandoc-9aecc17c1d411a4cd5474dfd88968d06111f7811.tar.gz |
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
-rw-r--r-- | Text/Pandoc/Writers/Markdown.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Text/Pandoc/Writers/Markdown.hs b/Text/Pandoc/Writers/Markdown.hs index 4b365773f..2b4ae8d0a 100644 --- a/Text/Pandoc/Writers/Markdown.hs +++ b/Text/Pandoc/Writers/Markdown.hs @@ -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 |