From 85ed24e849975051f370dd8bf98c6c62ca92447a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 29 Aug 2018 14:40:04 -0700 Subject: RSTR reader: don't skip link definitions after comments. Closes #4860. --- src/Text/Pandoc/Readers/RST.hs | 1 + test/command/4860.md | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 test/command/4860.md diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 576c3b77c..6a9e7cb95 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -172,6 +172,7 @@ parseRST = do docMinusKeys <- concat <$> manyTill (referenceKey <|> anchorDef <|> noteBlock <|> citationBlock <|> + (snd <$> withRaw comment) <|> headerBlock <|> lineClump) eof setInput docMinusKeys setPosition startPos diff --git a/test/command/4860.md b/test/command/4860.md new file mode 100644 index 000000000..9198f68d7 --- /dev/null +++ b/test/command/4860.md @@ -0,0 +1,9 @@ +``` +% pandoc -f rst -t native +This is broken_. + +.. ***** REFERENCES FOLLOW ***** +.. _broken: http://google.com +^D +[Para [Str "This",Space,Str "is",Space,Link ("",[],[]) [Str "broken"] ("http://google.com",""),Str "."]] +``` -- cgit v1.2.3