on master help sign in
Improved the compaction a bit more.
commit8f11bbd1d7cd81572ddc433aa1706bc2d2db4c8d authorNicole Rauch <nicole.m@gmx.de> dateSun 14 Aug 2016, 19:37 (10 years ago) parentec1486c
2 files changed+3−2
src/Hakyll/Web/CompressCss.hs+1−2 tests/Hakyll/Web/CompressCss/Tests.hs+2
src/Hakyll/Web/CompressCss.hs+1−2
@@ -39,11 +39,10 @@ compressSeparators str
3939 | isPrefixOf "'" str = head str : retainConstants compressSeparators "'" (drop 1 str)
4040 | stripFirst = compressSeparators (drop 1 str)
4141 | stripSecond = compressSeparators (head str : (drop 2 str))
42− | isPrefixOf ";}" str = '}' : compressSeparators (drop 2 str)
4342 | otherwise = head str : compressSeparators (drop 1 str)
4443 where
4544 prefix p = isPrefixOf p str
46− stripFirst = or $ map prefix [" ", " {", " }", ";;"]
45+ stripFirst = or $ map prefix [" ", " {", " }", ";;", ";}"]
4746 stripSecond = or $ map prefix ["{ ", "} ", "; "]
4847
4948--------------------------------------------------------------------------------
tests/Hakyll/Web/CompressCss/Tests.hs+2
@@ -30,6 +30,8 @@ tests = testGroup "Hakyll.Web.CompressCss.Tests" $ concat
3030 -- compress separators
3131 , "}" @=? compressCss "; }"
3232 , "{};" @=? compressCss " { } ; "
33+ -- compress whitespace even after this curly brace
34+ , "}" @=? compressCss "; } "
3335 -- but do not compress separators inside of constants
3436 , "\" { } ; \"" @=? compressCss "\" { } ; \""
3537 -- don't compress separators at the start or end of constants