From 115cad888245179e4a455a74dd4d8139a760f776 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 10 Mar 2007 20:45:19 +0000 Subject: 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 --- src/Text/Pandoc/Readers/Markdown.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3