Added support for multiple classes in delimited code block.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1204 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
b06ddad4bc
commit
046c6b0d0d
1 changed files with 8 additions and 7 deletions
|
@ -303,23 +303,24 @@ codeBlockDelimiter len = try $ do
|
|||
Nothing -> count 3 (char '~') >> many (char '~') >>=
|
||||
return . (+ 3) . length
|
||||
many spaceChar
|
||||
lang <- option "" classAttribute
|
||||
lang <- option "" classAttributes
|
||||
blankline
|
||||
return (size, lang)
|
||||
|
||||
classAttribute = try $ do
|
||||
classAttributes = try $ do
|
||||
char '{'
|
||||
many spaceChar
|
||||
char '.'
|
||||
attrs <- many $ do char '.'
|
||||
attr <- many1 alphaNum
|
||||
many spaceChar
|
||||
char '}'
|
||||
return attr
|
||||
char '}'
|
||||
return $ unwords attrs
|
||||
|
||||
codeBlockDelimited = try $ do
|
||||
(size, lang) <- codeBlockDelimiter Nothing
|
||||
contents <- manyTill anyLine (codeBlockDelimiter (Just size))
|
||||
return $ CodeBlock lang $ concat contents
|
||||
return $ CodeBlock lang $ joinWithSep "\n" contents
|
||||
|
||||
codeBlockIndented = do
|
||||
contents <- many1 (indentedLine <|>
|
||||
|
|
Loading…
Reference in a new issue