git.iko.soy/typeable/pandoc
on master help sign in
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

commit2e683e8b534f3e10ffff6c0dd3cd7cab3ebd40a5 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 9 Feb 2008, 03:19 (19 years ago) parent24f22ee
1 file changed+2−1
Text/Pandoc/Readers/Markdown.hs+2−1
Text/Pandoc/Readers/Markdown.hs+2−1
@@ -299,7 +299,7 @@ codeBlock = codeBlockIndented <|> codeBlockDelimited
299299
300300codeBlockDelimiter len = try $ do
301301 size <- case len of
302− Just l -> count l (char '~') >> return l
302+ Just l -> count l (char '~') >> many (char '~') >> return l
303303 Nothing -> count 3 (char '~') >> many (char '~') >>=
304304 return . (+ 3) . length
305305 many spaceChar
@@ -320,6 +320,7 @@ classAttributes = try $ do
320320codeBlockDelimited = try $ do
321321 (size, lang) <- codeBlockDelimiter Nothing
322322 contents <- manyTill anyLine (codeBlockDelimiter (Just size))
323+ blanklines
323324 return $ CodeBlock lang $ joinWithSep "\n" contents
324325
325326codeBlockIndented = do