git.iko.soy/typeable/pandoc
on master help sign in
RST reader: don't strip final underscore from absolute URI.

Partially addresses #5763.

commit18d11103f5ea8d054cb65a5226d09a991c783aa0 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 29 Sep 2019, 13:01 (7 years ago) parent746c92a
1 file changed+7−3
src/Text/Pandoc/Readers/RST.hs+7−3
src/Text/Pandoc/Readers/RST.hs+7−3
@@ -1497,9 +1497,13 @@ explicitLink = try $ do
14971497 then B.str src
14981498 else label'
14991499 -- `link <google_>` is a reference link to _google!
1500− ((src',tit),attr) <- case reverse src of
1501− '_':xs -> lookupKey [] (toKey (reverse xs))
1502− _ -> return ((src, ""), nullAttr)
1500+ ((src',tit),attr) <-
1501+ if isURI src
1502+ then return ((src, ""), nullAttr)
1503+ else
1504+ case reverse src of
1505+ '_':xs -> lookupKey [] (toKey (reverse xs))
1506+ _ -> return ((src, ""), nullAttr)
15031507 return $ B.linkWith attr (escapeURI src') tit label''
15041508
15051509citationName :: PandocMonad m => RSTParser m String