RST reader: fix parsing of headers with trailing space.

This was a regression in pandoc 2.0.

Closes .
This commit is contained in:
John MacFarlane 2018-01-20 11:08:08 -08:00
parent d9dd9beda1
commit 957c0e110d
2 changed files with 8 additions and 1 deletions
src/Text/Pandoc/Readers
test/command

View file

@ -352,7 +352,7 @@ singleHeader' :: PandocMonad m => RSTParser m (Inlines, Char)
singleHeader' = try $ do
notFollowedBy' whitespace
lookAhead $ anyLine >> oneOf underlineChars
txt <- trimInlines . mconcat <$> many1 (do {notFollowedBy newline; inline})
txt <- trimInlines . mconcat <$> many1 (notFollowedBy blankline >> inline)
pos <- getPosition
let len = sourceColumn pos - 1
blankline

7
test/command/4280.md Normal file
View file

@ -0,0 +1,7 @@
```
% pandoc -f rst -t native
Driver
------
^D
[Header 1 ("driver",[],[]) [Str "Driver"]]
```