From a3162d341b2937113514b5f515cbc86141fbfcf2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 13 Sep 2021 22:57:08 -0700 Subject: RST reader: handle escaped colons in reference definitions. Cloess #7568. --- src/Text/Pandoc/Readers/RST.hs | 3 ++- test/command/7568.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/command/7568.md 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 ':' diff --git a/test/command/7568.md b/test/command/7568.md new file mode 100644 index 000000000..42f1e37b1 --- /dev/null +++ b/test/command/7568.md @@ -0,0 +1,11 @@ +``` +% pandoc -f rst +While `Labyrinth Lord: Revised Edition`_ (LLRE; PDF and POD) has been +criticized for not being a completely faithful retro-clone of the +Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still +holds a useful spot. + +.. _Labyrinth Lord\: Revised Edition: https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition +^D +

While Labyrinth Lord: Revised Edition (LLRE; PDF and POD) has been criticized for not being a completely faithful retro-clone of the Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still holds a useful spot.

+``` -- cgit v1.2.3