aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Parsing.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-09-11 20:47:07 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-09-12 08:45:03 -0700
commit58a096c0584bfa5e7c0992934a17fec280e64ba8 (patch)
tree056ab35a57b202068a8513c22cc114e82e0b2c0a /src/Text/Pandoc/Parsing.hs
parentbad3c88cb6fa65ffade5365001202c9c8df2a1c0 (diff)
downloadpandoc-58a096c0584bfa5e7c0992934a17fec280e64ba8.tar.gz
Text.Pandoc.Parsing: Handle trailing slash in 'uri'.
Diffstat (limited to 'src/Text/Pandoc/Parsing.hs')
-rw-r--r--src/Text/Pandoc/Parsing.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index d677f7a16..d4a1afbec 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -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"