@@ -271,7 +271,7 @@ rawLine = try (do
271271 contents <- many1 nonEndline
272272 end <- option "" (do
273273 newline
274− option "" indentSpaces
274+ option "" (try indentSpaces)
275275 return "\n")
276276 return (contents ++ end))
277277
@@ -405,7 +405,7 @@ listContinuation start = try (do
405405listContinuationLine start = try (do
406406 notFollowedBy' blankline
407407 notFollowedBy' start
408− option "" indentSpaces
408+ option "" (try indentSpaces)
409409 result <- manyTill anyChar newline
410410 return (result ++ "\n"))
411411
@@ -421,7 +421,7 @@ listItem start = try (do
421421 -- parse the extracted block, which may contain various block elements:
422422 rest <- getInput
423423 let raw = concat (first:continuations)
424− setInput $ raw
424+ setInput raw
425425 contents <- parseBlocks
426426 setInput rest
427427 updateState (\st -> st {stateParserContext = oldContext})
@@ -437,6 +437,35 @@ bulletList = try (do
437437 let items' = compactify items
438438 return (BulletList items'))
439439
440+-- definition lists
441+
442+definitionListItem = try $ do
443+ notFollowedBy blankline
444+ notFollowedBy' indentSpaces
445+ term <- manyTill inline newline
446+ raw <- many1 defRawBlock
447+ state <- getState
448+ let oldContext = stateParserContext state
449+ setState $ state {stateParserContext = ListItemState}
450+ -- parse the extracted block, which may contain various block elements:
451+ rest <- getInput
452+ setInput (concat raw)
453+ contents <- parseBlocks
454+ setInput rest
455+ updateState (\st -> st {stateParserContext = oldContext})
456+ return ((normalizeSpaces term), contents)
457+
458+defRawBlock = try $ do
459+ indentSpaces
460+ first <- anyLine
461+ rest <- manyTill (do {option "" (try indentSpaces);
462+ anyLine}) blanklines
463+ return $ (unlines (first:rest)) ++ "\n"
464+
465+definitionList = do
466+ items <- many1 definitionListItem
467+ return $ DefinitionList items
468+
440469--
441470-- paragraph block
442471--