on master help sign in
Also trim whitespace around colons.
commit9f850a9035c29de568fb61b9646f657f5935ab89 authorNicole Rauch <nicole.m@gmx.de> dateMon 15 Aug 2016, 00:05 (10 years ago) parentea0a8d5
2 files changed+4−2
src/Hakyll/Web/CompressCss.hs+2−2 tests/Hakyll/Web/CompressCss/Tests.hs+2
src/Hakyll/Web/CompressCss.hs+2−2
@@ -39,8 +39,8 @@ compressSeparators str
3939 | otherwise = head str : compressSeparators (drop 1 str)
4040 where
4141 isConstant = or $ map (isOfPrefix str) ["\"", "'"]
42− stripFirst = or $ map (isOfPrefix str) [" ", " {", " }", ";;", ";}"]
43− stripSecond = or $ map (isOfPrefix str) ["{ ", "} ", "; "]
42+ stripFirst = or $ map (isOfPrefix str) [" ", " {", " }", " :", ";;", ";}"]
43+ stripSecond = or $ map (isOfPrefix str) ["{ ", "} ", ": ", "; "]
4444
4545--------------------------------------------------------------------------------
4646-- | Compresses all whitespace.
tests/Hakyll/Web/CompressCss/Tests.hs+2
@@ -51,6 +51,8 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
5151 -- don't compress whitespace around separators in constants in the middle of a string
5252 , "abc '{ '" @=? compressCss "abc '{ '"
5353 , "abc \"{ \"" @=? compressCss "abc \"{ \""
54+ -- compress whitespace after colons
55+ , "abc:xyz" @=? compressCss "abc : xyz"
5456 -- compress multiple semicolons
5557 , ";" @=? compressCss ";;;;;;;"
5658 ]