on master help sign in
Also trim whitespace around colons.
9f850a9Nicole Rauch
src/Hakyll/Web/CompressCss.hs+2−2
@@ -39,8 +39,8 @@ compressSeparators str
39 | otherwise = head str : compressSeparators (drop 1 str)
39 | otherwise = head str : compressSeparators (drop 1 str)
40 where
40 where
41 isConstant = or $ map (isOfPrefix str) ["\"", "'"]
41 isConstant = or $ map (isOfPrefix str) ["\"", "'"]
42− stripFirst = or $ map (isOfPrefix str) [" ", " {", " }", ";;", ";}"]
42+ stripFirst = or $ map (isOfPrefix str) [" ", " {", " }", " :", ";;", ";}"]
43− stripSecond = or $ map (isOfPrefix str) ["{ ", "} ", "; "]
43+ stripSecond = or $ map (isOfPrefix str) ["{ ", "} ", ": ", "; "]
44
44
45--------------------------------------------------------------------------------
45--------------------------------------------------------------------------------
46-- | Compresses all whitespace.
46-- | Compresses all whitespace.
tests/Hakyll/Web/CompressCss/Tests.hs+2
@@ -51,6 +51,8 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
51 -- don't compress whitespace around separators in constants in the middle of a string
51 -- don't compress whitespace around separators in constants in the middle of a string
52 , "abc '{ '" @=? compressCss "abc '{ '"
52 , "abc '{ '" @=? compressCss "abc '{ '"
53 , "abc \"{ \"" @=? compressCss "abc \"{ \""
53 , "abc \"{ \"" @=? compressCss "abc \"{ \""
54+ -- compress whitespace after colons
55+ , "abc:xyz" @=? compressCss "abc : xyz"
54 -- compress multiple semicolons
56 -- compress multiple semicolons
55 , ";" @=? compressCss ";;;;;;;"
57 , ";" @=? compressCss ";;;;;;;"
56 ]
58 ]