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
This commit is contained in:
fiddlosopher 2008-02-09 03:19:17 +00:00
parent 24f22ee7ac
commit 2e683e8b53

View file

@ -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