summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-10 20:45:19 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-03-10 20:45:19 +0000
commit115cad888245179e4a455a74dd4d8139a760f776 (patch)
treee16ee9b6f90a29b6955a02789410dde9678671d5 /src
parentd277baebe4e8fa748515718ab917b529f39ab02a (diff)
Changed syntax of definition lists in Markdown parser:
+ definition blocks must be indented throughout (not just in first line) + compact lists can be formed by leaving no blank line between a definition and the next term git-svn-id: https://pandoc.googlecode.com/svn/trunk@568 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 70a94fb2c..01fa4788d 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -456,15 +456,16 @@ definitionListItem = try $ do
return ((normalizeSpaces term), contents)
defRawBlock = try $ do
- indentSpaces
- first <- anyLine
- rest <- manyTill (do {option "" (try indentSpaces);
- anyLine}) blanklines
- return $ (unlines (first:rest)) ++ "\n"
+ rawlines <- many1 (do {notFollowedBy' blankline; indentSpaces; anyLine})
+ trailing <- option "" blanklines
+ return $ (unlines rawlines) ++ trailing
definitionList = do
items <- many1 definitionListItem
- return $ DefinitionList items
+ let (terms, defs) = unzip items
+ let defs' = compactify defs
+ let items' = zip terms defs'
+ return $ DefinitionList items'
--
-- paragraph block