on master help sign in
Minimize <img>, patch by Chris Mears

Conflicts: tests/Hakyll/Web/Urls/Relativize/Tests.hs

commit2caa185504ec697b96b7bf28dd9d15d489777abf authorJasper Van der Jeugt <m@jaspervdj.be> dateWed 28 Nov 2012, 10:24 (14 years ago) parentdb45ea9
3 files changed+5−5
src/Hakyll/Web/Urls.hs+2−1 tests/Hakyll/Web/Urls/Relativize/Tests.hs+1−2 tests/Hakyll/Web/Urls/Tests.hs+2−2
src/Hakyll/Web/Urls.hs+2−1
@@ -29,7 +29,8 @@ withUrls f = renderTags' . map tag . TS.parseTags
2929--
3030renderTags' :: [TS.Tag String] -> String
3131renderTags' = TS.renderTagsOptions TS.renderOptions
32− { TS.optRawTag = (`elem` ["script", "style"]) . map toLower
32+ { TS.optRawTag = (`elem` ["script", "style"]) . map toLower
33+ , TS.optMinimize = (`elem` ["br", "img"])
3334 }
3435
3536-- | Convert a filepath to an URL starting from the site root
tests/Hakyll/Web/Urls/Relativize/Tests.hs+1−2
@@ -9,7 +9,6 @@ module Hakyll.Web.Urls.Relativize.Tests
99import Test.Framework (Test, testGroup)
1010import Test.HUnit ((@=?))
1111
12−
1312--------------------------------------------------------------------------------
1413import Hakyll.Web.Urls.Relativize
1514import TestSuite.Util
@@ -21,7 +20,7 @@ tests = testGroup "Hakyll.Web.Urls.Relativize.Tests" $
2120 fromAssertions "relativizeUrls"
2221 [ "<a href=\"../foo\">bar</a>" @=?
2322 relativizeUrlsWith ".." "<a href=\"/foo\">bar</a>"
24− , "<img src=\"../../images/lolcat.png\"></img>" @=?
23+ , "<img src=\"../../images/lolcat.png\" />" @=?
2524 relativizeUrlsWith "../.." "<img src=\"/images/lolcat.png\" />"
2625 , "<a href=\"http://haskell.org\">Haskell</a>" @=?
2726 relativizeUrlsWith "../.."
tests/Hakyll/Web/Urls/Tests.hs+2−2
@@ -21,8 +21,8 @@ tests = testGroup "Hakyll.Web.Urls.Tests" $ concat
2121 [ fromAssertions "withUrls"
2222 [ "<a href=\"FOO\">bar</a>" @=?
2323 withUrls (map toUpper) "<a href=\"foo\">bar</a>"
24− , "<img src=\"OH BAR\">" @=?
25− withUrls (map toUpper) "<img src=\"oh bar\">"
24+ , "<img src=\"OH BAR\" />" @=?
25+ withUrls (map toUpper) "<img src=\"oh bar\" />"
2626
2727 -- Test escaping
2828 , "<script>\"sup\"</script>" @=?