git.iko.soy/typeable/pandoc
on master help sign in
Text.Pandoc.Parsing: Handle trailing slash in 'uri'.
commit58a096c0584bfa5e7c0992934a17fec280e64ba8 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 11 Sep 2012, 20:47 (14 years ago) parentbad3c88
1 file changed+3−2
src/Text/Pandoc/Parsing.hs+3−2
src/Text/Pandoc/Parsing.hs+3−2
@@ -379,10 +379,11 @@ uri = try $ do
379379 char ')'
380380 return $ '(' : res ++ ")"
381381 str <- liftM concat $ many1 $ inParens <|> count 1 (innerPunct <|> uriChar)
382+ str' <- option str $ char '/' >> return (str ++ "/")
382383 -- now see if they amount to an absolute URI
383− case parseURI (escapeURI str) of
384+ case parseURI (escapeURI str') of
384385 Just uri' -> if uriScheme uri' `elem` protocols
385− then return (str, show uri')
386+ then return (str', show uri')
386387 else fail "not a URI"
387388 Nothing -> fail "not a URI"
388389