aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-10-09 08:54:27 -0700
committerJohn MacFarlane <[email protected]>2024-10-09 08:54:27 -0700
commitc5bab883ec8ea64f5fe56f1fd6be66e31dd9a86a (patch)
tree8d69607cd1d90d9dadc6feb442995bc8f5f70931 /src
parentbdb1172385422d46243e6b5ede31fb6054fade5f (diff)
RST reader: ignore newlines in URL in explicit link.
Closes #10279.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index ce8a83628..52b0b2544 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