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
This commit is contained in:
fiddlosopher 2007-03-10 20:45:19 +00:00
parent d277baebe4
commit 115cad8882

View file

@ -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