git.iko.soy/typeable/pandoc
on master help sign in
Text.Pandoc.Parsing: Handle trailing slash in 'uri'.
58a096cJohn MacFarlane
src/Text/Pandoc/Parsing.hs+3−2
@@ -379,10 +379,11 @@ uri = try $ do
379 char ')'
379 char ')'
380 return $ '(' : res ++ ")"
380 return $ '(' : res ++ ")"
381 str <- liftM concat $ many1 $ inParens <|> count 1 (innerPunct <|> uriChar)
381 str <- liftM concat $ many1 $ inParens <|> count 1 (innerPunct <|> uriChar)
382+ str' <- option str $ char '/' >> return (str ++ "/")
382 -- now see if they amount to an absolute URI
383 -- now see if they amount to an absolute URI
383− case parseURI (escapeURI str) of
384+ case parseURI (escapeURI str') of
384 Just uri' -> if uriScheme uri' `elem` protocols
385 Just uri' -> if uriScheme uri' `elem` protocols
385− then return (str, show uri')
386+ then return (str', show uri')
386 else fail "not a URI"
387 else fail "not a URI"
387 Nothing -> fail "not a URI"
388 Nothing -> fail "not a URI"
388
389