RST reader: allow empty list items (as docutils does).

Closes #4193.
This commit is contained in:
John MacFarlane
2017-12-24 13:02:18 -08:00
parent bb5f4c9b22
commit ee5fe9bf2c
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -547,7 +547,7 @@ bulletListStart :: Monad m => ParserT [Char] st m Int
bulletListStart = try $ do
notFollowedBy' hrule -- because hrules start out just like lists
marker <- oneOf bulletListMarkers
white <- many1 spaceChar
white <- many1 spaceChar <|> "" <$ lookAhead (char '\n')
return $ length (marker:white)
-- parses ordered list start and returns its length (inc following whitespace)
@@ -556,7 +556,7 @@ orderedListStart :: Monad m => ListNumberStyle
-> RSTParser m Int
orderedListStart style delim = try $ do
(_, markerLen) <- withHorizDisplacement (orderedListMarker style delim)
white <- many1 spaceChar
white <- many1 spaceChar <|> "" <$ lookAhead (char '\n')
return $ markerLen + length white
-- parse a line of a list item
+10
View File
@@ -0,0 +1,10 @@
```
% pandoc -f rst -t native
-
a
- b
^D
[BulletList
[[Plain [Str "a"]]
,[Plain [Str "b"]]]]
```