RST reader: fix parsing of headers with trailing space.
This was a regression in pandoc 2.0. Closes #4280.
This commit is contained in:
parent
d9dd9beda1
commit
957c0e110d
2 changed files with 8 additions and 1 deletions
|
@ -352,7 +352,7 @@ singleHeader' :: PandocMonad m => RSTParser m (Inlines, Char)
|
||||||
singleHeader' = try $ do
|
singleHeader' = try $ do
|
||||||
notFollowedBy' whitespace
|
notFollowedBy' whitespace
|
||||||
lookAhead $ anyLine >> oneOf underlineChars
|
lookAhead $ anyLine >> oneOf underlineChars
|
||||||
txt <- trimInlines . mconcat <$> many1 (do {notFollowedBy newline; inline})
|
txt <- trimInlines . mconcat <$> many1 (notFollowedBy blankline >> inline)
|
||||||
pos <- getPosition
|
pos <- getPosition
|
||||||
let len = sourceColumn pos - 1
|
let len = sourceColumn pos - 1
|
||||||
blankline
|
blankline
|
||||||
|
|
7
test/command/4280.md
Normal file
7
test/command/4280.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
```
|
||||||
|
% pandoc -f rst -t native
|
||||||
|
Driver
|
||||||
|
------
|
||||||
|
^D
|
||||||
|
[Header 1 ("driver",[],[]) [Str "Driver"]]
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue