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:
parent
d277baebe4
commit
115cad8882
1 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue