@@ -605,9 +605,10 @@ definitionListItem parseMarkerGetLength = try $ do
605 markerLength <- parseMarkerGetLength
605 markerLength <- parseMarkerGetLength
606 term <- manyTill (noneOf "\n\r") (try $ string "::")
606 term <- manyTill (noneOf "\n\r") (try $ string "::")
607 first <- anyLineNewline
607 first <- anyLineNewline
608+ blank <- option "" ("\n" <$ blankline)
608 cont <- concat <$> many (listContinuation markerLength)
609 cont <- concat <$> many (listContinuation markerLength)
609 term' <- parseFromString inline term
610 term' <- parseFromString inline term
610− contents' <- parseFromString parseBlocks $ first ++ cont
611+ contents' <- parseFromString parseBlocks $ first ++ blank ++ cont
611 return $ (,) <$> term' <*> fmap (:[]) contents'
612 return $ (,) <$> term' <*> fmap (:[]) contents'
@@ -617,16 +618,18 @@ listItem :: OrgParser Int
617listItem start = try $ do
618listItem start = try $ do
618 markerLength <- try start
619 markerLength <- try start
619 firstLine <- anyLineNewline
620 firstLine <- anyLineNewline
621+ blank <- option "" ("\n" <$ blankline)
620 rest <- concat <$> many (listContinuation markerLength)
622 rest <- concat <$> many (listContinuation markerLength)
621− parseFromString parseBlocks $ firstLine ++ rest
623+ parseFromString parseBlocks $ firstLine ++ blank ++ rest
623-- continuation of a list item - indented and separated by blankline or endline.
625-- continuation of a list item - indented and separated by blankline or endline.
624-- Note: nested lists are parsed as continuations.
626-- Note: nested lists are parsed as continuations.
625listContinuation :: Int
627listContinuation :: Int
626 -> OrgParser String
628 -> OrgParser String
627listContinuation markerLength = try $
629listContinuation markerLength = try $
628− mappend <$> many blankline
630+ notFollowedBy' blankline
629− <*> (concat <$> many1 listLine)
631+ *> (mappend <$> (concat <$> many1 listLine)
630 where listLine = try $ indentWith markerLength *> anyLineNewline
633 where listLine = try $ indentWith markerLength *> anyLineNewline
632anyLineNewline :: OrgParser String
635anyLineNewline :: OrgParser String