Skip to content

Commit

Permalink
RST reader: ignore newlines in URL in explicit link.
Browse files Browse the repository at this point in the history
Closes #10279.
  • Loading branch information
jgm committed Oct 9, 2024
1 parent bdb1172 commit c5bab88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Text/Pandoc/Readers/RST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/command/10279.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```
% pandoc -f rst
See `the full compatibility guidelines <https://
example.com>`_ for more information.
^D
<p>See <a href="https://example.com">the full compatibility
guidelines</a> for more information.</p>
```

0 comments on commit c5bab88

Please sign in to comment.