From 41b14dc891b188e9daeeb322dab80e5fb4be0cd3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 5 Dec 2025 10:46:24 +0100 Subject: RST reader: fix definition lists where term ends with `-`. This reverts some old code giving special treatment to lines ending in hyphens; I don't understand why it was there, because rst2html does not seem to do this. Closes #11323. --- src/Text/Pandoc/Readers/RST.hs | 8 -------- test/command/11323.md | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 test/command/11323.md diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 5d5e176ee..9cec47c1f 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -1520,20 +1520,12 @@ inlineContent = choice [ whitespace , str , endline , smart - , hyphens , escapedChar , symbol ] "inline content" parseInlineFromText :: PandocMonad m => Text -> RSTParser m Inlines parseInlineFromText = parseFromString' (trimInlines . mconcat <$> many inline) -hyphens :: Monad m => RSTParser m Inlines -hyphens = do - result <- many1Char (char '-') - optional endline - -- don't want to treat endline after hyphen or dash as a space - return $ B.str result - escapedChar :: Monad m => RSTParser m Inlines escapedChar = do c <- escaped anyChar if c == ' ' || c == '\n' || c == '\r' diff --git a/test/command/11323.md b/test/command/11323.md new file mode 100644 index 000000000..e2e5e1802 --- /dev/null +++ b/test/command/11323.md @@ -0,0 +1,12 @@ +``` +% pandoc -f rst +foo- + bar +^D +
+
foo-
+
+

bar

+
+
+``` -- cgit v1.2.3