Closed GoogleCodeExporter closed 9 years ago
An imperfect solution:
Author: Brian Sniffen <bts@v-rin.home>
Date: Wed Feb 10 01:44:22 2010 -0500
Modify urlForPage to never generate a leading //
diff --git a/Network/Gitit/Framework.hs b/Network/Gitit/Framework.hs
index 2fcfb2b..797e131 100644
--- a/Network/Gitit/Framework.hs
+++ b/Network/Gitit/Framework.hs
@@ -274,10 +274,12 @@ isSourceCode path' =
-- | Returns encoded URL path for the page with the given name, relative to
-- the wiki base.
urlForPage :: String -> String
-urlForPage page = "/" ++
+urlForPage page = initialChar page ++
encString True (\c -> isAscii c && (c `notElem` "?&")) (map spaceToPlus page)
where spaceToPlus ' ' = '+'
spaceToPlus c = c
+ initialChar ('/':_) = ""
+ initialChar _ = "/"
-- / and @ are left unescaped so that browsers recognize relative URLs and talk
-- | Returns the filestore path of the file containing the page's source.
Original comment by brian.sn...@gmail.com
on 10 Feb 2010 at 6:55
Fixed in HEAD c4b694f
Original comment by fiddloso...@gmail.com
on 14 Feb 2010 at 5:59
Original comment by fiddloso...@gmail.com
on 14 Feb 2010 at 5:59
Original issue reported on code.google.com by
brian.sn...@gmail.com
on 9 Feb 2010 at 11:29