Text.Pandoc.Parsing: Handle trailing slash in 'uri'.
This commit is contained in:
parent
bad3c88cb6
commit
58a096c058
1 changed files with 3 additions and 2 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue