aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-16 01:39:05 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-16 01:39:05 +0000
commit7ad17fe5cff04e0b68be5c4a08339bb53d3d176d (patch)
treee3075505876e6549b2bdd517623d8a163fdb31ff /Text/Pandoc/Readers
parent4d5c71e183f443306033bdc53e0d2e8144af31d3 (diff)
downloadpandoc-7ad17fe5cff04e0b68be5c4a08339bb53d3d176d.tar.gz
Markdown reader: Ignore blank line after ~~~~~~~~ in delimited code blocks.
Rationale: these are useful for literate haskell, but lhs requires a blank line before the haskell code, and we don't want spurious blank lines in the output. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1454 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc/Readers')
-rw-r--r--Text/Pandoc/Readers/Markdown.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs
index 29e47e37b..0326bac95 100644
--- a/Text/Pandoc/Readers/Markdown.hs
+++ b/Text/Pandoc/Readers/Markdown.hs
@@ -379,6 +379,8 @@ keyValAttr = try $ do
codeBlockDelimited :: GenParser Char st Block
codeBlockDelimited = try $ do
(size, attr) <- codeBlockDelimiter Nothing
+ optional blankline -- this helps make literate haskell possible; it requires
+ -- a blank line between comment and code
contents <- manyTill anyLine (codeBlockDelimiter (Just size))
blanklines
return $ CodeBlock attr $ intercalate "\n" contents