aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-29 13:01:00 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-29 13:01:00 -0700
commit18d11103f5ea8d054cb65a5226d09a991c783aa0 (patch)
treea934f7a58a11b04f754ba0b0bc6f95a978e645c6 /src/Text/Pandoc/Readers
parent746c92a41a4f1df5ac97246fe69555cef5419d00 (diff)
downloadpandoc-18d11103f5ea8d054cb65a5226d09a991c783aa0.tar.gz
RST reader: don't strip final underscore from absolute URI.
Partially addresses #5763.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index ce7af9866..35b9ade65 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -1497,9 +1497,13 @@ explicitLink = try $ do
then B.str src
else label'
-- `link <google_>` is a reference link to _google!
- ((src',tit),attr) <- case reverse src of
- '_':xs -> lookupKey [] (toKey (reverse xs))
- _ -> return ((src, ""), nullAttr)
+ ((src',tit),attr) <-
+ if isURI src
+ then return ((src, ""), nullAttr)
+ else
+ case reverse src of
+ '_':xs -> lookupKey [] (toKey (reverse xs))
+ _ -> return ((src, ""), nullAttr)
return $ B.linkWith attr (escapeURI src') tit label''
citationName :: PandocMonad m => RSTParser m String