From 046c6b0d0dc33cabaeca294d1cbd39fd4de42ff4 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 9 Feb 2008 03:19:01 +0000 Subject: Added support for multiple classes in delimited code block. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1204 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Text/Pandoc') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index e58a80b99..eee22859f 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -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 '.' - attr <- many1 alphaNum - many spaceChar + attrs <- many $ do char '.' + attr <- many1 alphaNum + many spaceChar + return attr char '}' - return attr + 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 <|> -- cgit v1.2.3