aboutsummaryrefslogtreecommitdiff
path: root/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:19:01 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-02-09 03:19:01 +0000
commit046c6b0d0dc33cabaeca294d1cbd39fd4de42ff4 (patch)
tree5bdc056094a50e712aa29fead3f2207b3c572ee9 /Text/Pandoc
parentb06ddad4bca82c4215bcdbd601566f7f1b1eb45d (diff)
downloadpandoc-046c6b0d0dc33cabaeca294d1cbd39fd4de42ff4.tar.gz
Added support for multiple classes in delimited code block.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1204 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc')
-rw-r--r--Text/Pandoc/Readers/Markdown.hs15
1 files changed, 8 insertions, 7 deletions
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 <|>