@@ -1286,6 +1286,7 @@ substKey = try $ do
1286
1286
anonymousKey :: PandocMonad m => RSTParser m ()
1287
1287
anonymousKey = try $ do
1288
1288
oneOfStrings [" .. __:" , " __" ]
1289
+ skipMany1 spaceChar
1289
1290
src <- targetURI
1290
1291
-- we need to ensure that the keys are ordered by occurrence in
1291
1292
-- the document.
@@ -1462,15 +1463,14 @@ table = gridTable <|> simpleTable False <|> simpleTable True <?> "table"
1462
1463
--
1463
1464
1464
1465
inline :: PandocMonad m => RSTParser m Inlines
1465
- inline = choice [ note -- can start with whitespace, so try before ws
1466
- , link
1467
- , inlineAnchor
1468
- , strong
1469
- , emph
1470
- , code
1471
- , subst
1472
- , interpretedRole
1473
- , inlineContent ] <?> " inline"
1466
+ inline =
1467
+ (note -- can start with whitespace, so try before ws
1468
+ <|> do notAfterString >>= guard
1469
+ (link <|> inlineAnchor <|> strong <|> emph)
1470
+ <|> code
1471
+ <|> subst
1472
+ <|> interpretedRole
1473
+ <|> inlineContent) <?> " inline"
1474
1474
1475
1475
-- strings, spaces and other characters that can appear either by
1476
1476
-- themselves or within inline markup
@@ -1730,6 +1730,7 @@ referenceLink :: PandocMonad m => RSTParser m Inlines
1730
1730
referenceLink = try $ do
1731
1731
ref <- (referenceName <|> citationName) <* char ' _'
1732
1732
isAnonymous <- (True <$ char ' _' ) <|> pure False
1733
+ eof <|> notFollowedBy alphaNum
1733
1734
let ref' = if isAnonymous
1734
1735
then " _"
1735
1736
else ref
@@ -1797,7 +1798,7 @@ smart :: PandocMonad m => RSTParser m Inlines
1797
1798
smart = smartPunctuation inline
1798
1799
1799
1800
inlineAnchor :: PandocMonad m => RSTParser m Inlines
1800
- inlineAnchor = do
1801
+ inlineAnchor = try $ do
1801
1802
char ' _'
1802
1803
name <- quotedReferenceName <|> simpleReferenceName
1803
1804
let ident = textToIdentifier mempty name
0 commit comments