git.iko.soy/typeable/pandoc
on master help sign in
RST reader: don't strip final underscore from absolute URI.
18d1110John MacFarlane
src/Text/Pandoc/Readers/RST.hs+7−3
@@ -1497,9 +1497,13 @@ explicitLink = try $ do
1497 then B.str src
1497 then B.str src
1498 else label'
1498 else label'
1499 -- `link <google_>` is a reference link to _google!
1499 -- `link <google_>` is a reference link to _google!
1500+ ((src',tit),attr) <-
1501+ if isURI src
1502+ then return ((src, ""), nullAttr)
1503+ else
1500− ((src',tit),attr) <- case reverse src of
1504+ case reverse src of
1501− '_':xs -> lookupKey [] (toKey (reverse xs))
1505+ '_':xs -> lookupKey [] (toKey (reverse xs))
1502− _ -> return ((src, ""), nullAttr)
1506+ _ -> return ((src, ""), nullAttr)
1503 return $ B.linkWith attr (escapeURI src') tit label''
1507 return $ B.linkWith attr (escapeURI src') tit label''
1504
1508
1505citationName :: PandocMonad m => RSTParser m String
1509citationName :: PandocMonad m => RSTParser m String