@@ -444,6 +444,9 @@ block = choice [ mempty <$ blanklines
444 , codeBlockFenced
444 , codeBlockFenced
445 , yamlMetaBlock
445 , yamlMetaBlock
446 , guardEnabled Ext_latex_macros *> (macro >>= return . return)
446 , guardEnabled Ext_latex_macros *> (macro >>= return . return)
447+ -- note: bulletList needs to be before header because of
448+ -- the possibility of empty list items: -
448 , lhsCodeBlock
451 , lhsCodeBlock
449 , rawTeXBlock
452 , rawTeXBlock
@@ -454,7 +457,6 @@ block = choice [ mempty <$ blanklines
454 , codeBlockIndented
457 , codeBlockIndented
455 , blockQuote
458 , blockQuote
458 , orderedList
460 , orderedList
459 , definitionList
461 , definitionList
460 , noteBlock
462 , noteBlock
@@ -699,7 +701,7 @@ bulletListStart = try $ do
699 skipNonindentSpaces
701 skipNonindentSpaces
700 notFollowedBy' (() <$ hrule) -- because hrules start out just like lists
702 notFollowedBy' (() <$ hrule) -- because hrules start out just like lists
701 satisfy isBulletListMarker
703 satisfy isBulletListMarker
702− spaceChar
704+ spaceChar <|> lookAhead newline
703 skipSpaces
705 skipSpaces
705anyOrderedListStart :: MarkdownParser (Int, ListNumberStyle, ListNumberDelim)
707anyOrderedListStart :: MarkdownParser (Int, ListNumberStyle, ListNumberDelim)
@@ -727,7 +729,6 @@ listStart = bulletListStart <|> (anyOrderedListStart >> return ())
727-- parse a line of a list item (start = parser for beginning of list item)
729-- parse a line of a list item (start = parser for beginning of list item)
728listLine :: MarkdownParser String
730listLine :: MarkdownParser String
729listLine = try $ do
731listLine = try $ do
730− notFollowedBy blankline
731 notFollowedBy' (do indentSpaces
732 notFollowedBy' (do indentSpaces
732 many (spaceChar)
733 many (spaceChar)
733 listStart)
734 listStart)
@@ -740,7 +741,7 @@ rawListItem :: MarkdownParser a
740rawListItem start = try $ do
741rawListItem start = try $ do
742 first <- listLine
743 first <- listLine
743− rest <- many (notFollowedBy listStart >> listLine)
744+ rest <- many (notFollowedBy listStart >> notFollowedBy blankline >> listLine)
744 blanks <- many blankline
745 blanks <- many blankline
745 return $ unlines (first:rest) ++ blanks
746 return $ unlines (first:rest) ++ blanks