Text.Pandoc.Parsing: Handle trailing slash in 'uri'.

This commit is contained in:
John MacFarlane 2012-09-11 20:47:07 -07:00
parent bad3c88cb6
commit 58a096c058

View file

@ -379,10 +379,11 @@ uri = try $ do
char ')'
return $ '(' : res ++ ")"
str <- liftM concat $ many1 $ inParens <|> count 1 (innerPunct <|> uriChar)
str' <- option str $ char '/' >> return (str ++ "/")
-- now see if they amount to an absolute URI
case parseURI (escapeURI str) of
case parseURI (escapeURI str') of
Just uri' -> if uriScheme uri' `elem` protocols
then return (str, show uri')
then return (str', show uri')
else fail "not a URI"
Nothing -> fail "not a URI"