on master help sign in
Add test for new relativizeUrls
c015be0Jasper Van der Jeugt
src/Hakyll/Web/Urls/Relativize.hs+2−1
@@ -44,4 +44,5 @@ relativizeUrls :: String -- ^ Path to the site root
44 -> String -- ^ Resulting HTML
44 -> String -- ^ Resulting HTML
45relativizeUrls root = withUrls rel
45relativizeUrls root = withUrls rel
46 where
46 where
47− rel x = if "/" `isPrefixOf` x && not ("//" `isPrefixOf` x) then root ++ x else x
47+ isRel x = "/" `isPrefixOf` x && not ("//" `isPrefixOf` x)
48+ rel x = if isRel x then root ++ x else x
tests/Hakyll/Web/Urls/Relativize/Tests.hs+5
@@ -17,4 +17,9 @@ tests = fromAssertions "relativizeUrls"
17 relativizeUrls "../.." "<img src=\"/images/lolcat.png\" />"
17 relativizeUrls "../.." "<img src=\"/images/lolcat.png\" />"
18 , "<a href=\"http://haskell.org\">Haskell</a>" @=?
18 , "<a href=\"http://haskell.org\">Haskell</a>" @=?
19 relativizeUrls "../.." "<a href=\"http://haskell.org\">Haskell</a>"
19 relativizeUrls "../.." "<a href=\"http://haskell.org\">Haskell</a>"
20+ , "<a href=\"http://haskell.org\">Haskell</a>" @=?
21+ relativizeUrls "../.." "<a href=\"http://haskell.org\">Haskell</a>"
22+ , "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>" @=?
23+ relativizeUrls "../.."
24+ "<script src=\"//ajax.googleapis.com/jquery.min.js\"></script>"
20 ]
25 ]
web/about.markdown+5−4
@@ -28,9 +28,10 @@ you will have to license your code under a GPL-compatible license.
28Hakyll was originally written by [Jasper Van der Jeugt](http://jaspervdj.be),
28Hakyll was originally written by [Jasper Van der Jeugt](http://jaspervdj.be),
29who still maintains the package. Contributors:
29who still maintains the package. Contributors:
30
30
31−- [seschwar](http://github.com/seschwar)
31+- [Andy Irving](https://github.com/irv)
32−- [JD Marble](http://github.com/jdmarble)
33−- [sargon](http://github.com/sargon)
34−- [Paolo Veronelli](http://github.com/paolino)
35- [Benedict Eastaugh](http://extralogical.net/)
32- [Benedict Eastaugh](http://extralogical.net/)
33+- [JD Marble](http://github.com/jdmarble)
36- [Nicolas Wu](http://zenzike.com/)
34- [Nicolas Wu](http://zenzike.com/)
35+- [Paolo Veronelli](http://github.com/paolino)
36+- [sargon](http://github.com/sargon)
37+- [seschwar](http://github.com/seschwar)