diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index ce8a83628f90..52b0b2544189 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -1604,7 +1604,9 @@ explicitLink = try $ do notFollowedBy (char '`') -- `` marks start of inline code label' <- trimInlines . mconcat <$> manyTill (notFollowedBy (char '`') >> inlineContent) (char '<') - src <- trim <$> manyTillChar (noneOf ">\n") (char '>') + src <- trim . T.pack . filter (/= '\n') <$> -- see #10279 + manyTill (noneOf ">\n" <|> (char '\n' <* notFollowedBy blankline)) + (char '>') skipSpaces string "`_" optional $ char '_' -- anonymous form diff --git a/test/command/10279.md b/test/command/10279.md new file mode 100644 index 000000000000..5029c419442c --- /dev/null +++ b/test/command/10279.md @@ -0,0 +1,9 @@ +``` +% pandoc -f rst +See `the full compatibility guidelines `_ for more information. +^D +

See the full compatibility +guidelines for more information.

+ +```