diff options
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 4 | ||||
-rw-r--r-- | test/command/4193.md | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 6b5d0a331..9f259d958 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -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 diff --git a/test/command/4193.md b/test/command/4193.md new file mode 100644 index 000000000..44c7d70cc --- /dev/null +++ b/test/command/4193.md @@ -0,0 +1,10 @@ +``` +% pandoc -f rst -t native +- + a +- b +^D +[BulletList + [[Plain [Str "a"]] + ,[Plain [Str "b"]]]] +``` |