RST reader: fix logic for ending comments.

Previously comments sometimes got extended too far.  Closes #7134.
This commit is contained in:
John MacFarlane 2021-03-09 13:03:27 -08:00
parent a8b2031bb4
commit 1c23e3a824
2 changed files with 18 additions and 1 deletions

View file

@ -613,8 +613,9 @@ comment = try $ do
string ".."
skipMany1 spaceChar <|> (() <$ lookAhead newline)
-- notFollowedBy' directiveLabel -- comment comes after directive so unnec.
manyTill anyChar blanklines
_ <- anyLine
optional indentedBlock
optional blanklines
return mempty
directiveLabel :: Monad m => RSTParser m Text

16
test/command/7134.md Normal file
View file

@ -0,0 +1,16 @@
```
% pandoc -f rst -t native
This is a paragraph.
This is a block quote.
..
This should be a second block quote.
^D
[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "paragraph."]
,BlockQuote
[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote."]]
,BlockQuote
[Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "second",Space,Str "block",Space,Str "quote."]]]
```