RST reader: Fixed bug in parsing explicit links (resolves Issue #44).
The problem was that we were looking for inlines until a '<' character
signaled the start of the URL. So if you hit a reference-style link,
it would keep looking til the end of the document. Fix: change
inline => (notFollowedBy (char '`') >> inline). Note that this won't
allow code inlines in links, but these aren't allowed in resT anyway.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1175 788f1e2b-df1e-0410-8736-df70ead52e1b
commitb9e30ca8b7b8c5189ec2f6ad63301027070f6387
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
dateSun 6 Jan 2008, 19:46 (19 years ago)
parent85657ad
Text/Pandoc/Readers/RST.hs+3−2
@@ -570,8 +570,9 @@ link = choice [explicitLink, referenceLink, autoLink] <?> "link"
570570
571571explicitLink = try $ do
572572 char '`'
573− notFollowedBy (char '`') -- `` is marks start of inline code
574− label <- manyTill inline (try (spaces >> char '<'))
573+ notFollowedBy (char '`') -- `` marks start of inline code
574+ label <- manyTill (notFollowedBy (char '`') >> inline)
575+ (try (spaces >> char '<'))
575576 src <- manyTill (noneOf ">\n ") (char '>')
576577 skipSpaces
577578 string "`_"