aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-09-13 22:57:08 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-09-13 22:57:08 -0700
commita3162d341b2937113514b5f515cbc86141fbfcf2 (patch)
tree47f9962bb1464c1d0d1a2006a79726ca3915cd6d /src/Text/Pandoc/Readers
parentb34dc28926c11701f61e91e6f64244b438e8f701 (diff)
downloadpandoc-a3162d341b2937113514b5f515cbc86141fbfcf2.tar.gz
RST reader: handle escaped colons in reference definitions.
Cloess #7568.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index ff891d3c6..458a2d48b 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -1155,10 +1155,11 @@ referenceNames = do
let rn = try $ do
string ".. _"
ref <- quotedReferenceName
- <|> manyChar ( noneOf ":\n"
+ <|> manyChar ( noneOf "\\:\n"
<|> try (char '\n' <*
string " " <*
notFollowedBy blankline)
+ <|> try (char '\\' *> char ':')
<|> try (char ':' <* lookAhead alphaNum)
)
char ':'