summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicole Rauch <nicole.m@gmx.de>2016-08-15 00:05:19 +0200
committerNicole Rauch <nicole.m@gmx.de>2016-08-15 00:05:19 +0200
commit9f850a9035c29de568fb61b9646f657f5935ab89 (patch)
tree689d57d7c1d02aeb8f7fe2817f599cd9417313d5
parentea0a8d5226f653dd37b6801f52dc5ad58f3a5809 (diff)
downloadhakyll-9f850a9035c29de568fb61b9646f657f5935ab89.tar.gz
Also trim whitespace around colons.
-rw-r--r--src/Hakyll/Web/CompressCss.hs4
-rw-r--r--tests/Hakyll/Web/CompressCss/Tests.hs2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Hakyll/Web/CompressCss.hs b/src/Hakyll/Web/CompressCss.hs
index 239c383..0371d8b 100644
--- a/src/Hakyll/Web/CompressCss.hs
+++ b/src/Hakyll/Web/CompressCss.hs
@@ -39,8 +39,8 @@ compressSeparators str
| otherwise = head str : compressSeparators (drop 1 str)
where
isConstant = or $ map (isOfPrefix str) ["\"", "'"]
- stripFirst = or $ map (isOfPrefix str) [" ", " {", " }", ";;", ";}"]
- stripSecond = or $ map (isOfPrefix str) ["{ ", "} ", "; "]
+ stripFirst = or $ map (isOfPrefix str) [" ", " {", " }", " :", ";;", ";}"]
+ stripSecond = or $ map (isOfPrefix str) ["{ ", "} ", ": ", "; "]
--------------------------------------------------------------------------------
-- | Compresses all whitespace.
diff --git a/tests/Hakyll/Web/CompressCss/Tests.hs b/tests/Hakyll/Web/CompressCss/Tests.hs
index c3fc840..b356388 100644
--- a/tests/Hakyll/Web/CompressCss/Tests.hs
+++ b/tests/Hakyll/Web/CompressCss/Tests.hs
@@ -51,6 +51,8 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
-- don't compress whitespace around separators in constants in the middle of a string
, "abc '{ '" @=? compressCss "abc '{ '"
, "abc \"{ \"" @=? compressCss "abc \"{ \""
+ -- compress whitespace after colons
+ , "abc:xyz" @=? compressCss "abc : xyz"
-- compress multiple semicolons
, ";" @=? compressCss ";;;;;;;"
]