From 2e683e8b534f3e10ffff6c0dd3cd7cab3ebd40a5 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 9 Feb 2008 03:19:17 +0000 Subject: Fixed delimited code blocks: eat blank lines afterwards, and allow end line to contain more tildes than beginning line. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1206 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Text/Pandoc/Readers/Markdown.hs') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index 73b7e688a..c4d8778aa 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -299,7 +299,7 @@ codeBlock = codeBlockIndented <|> codeBlockDelimited codeBlockDelimiter len = try $ do size <- case len of - Just l -> count l (char '~') >> return l + Just l -> count l (char '~') >> many (char '~') >> return l Nothing -> count 3 (char '~') >> many (char '~') >>= return . (+ 3) . length many spaceChar @@ -320,6 +320,7 @@ classAttributes = try $ do codeBlockDelimited = try $ do (size, lang) <- codeBlockDelimiter Nothing contents <- manyTill anyLine (codeBlockDelimiter (Just size)) + blanklines return $ CodeBlock lang $ joinWithSep "\n" contents codeBlockIndented = do -- cgit v1.2.3