@@ -33,14 +33,15 @@ compressCss = compressSeparators . stripComments . compressWhitespace
3333compressSeparators :: String -> String
3434compressSeparators [] = []
3535compressSeparators str
36− | isConstant = head str : retainConstants compressSeparators (head str) (drop 1 str)
36+ | isConstant = head str : retainConstants compressSeparators (head str) (drop 1 str)
3737 | stripFirst = compressSeparators (drop 1 str)
3838 | stripSecond = compressSeparators (head str : (drop 2 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) $ [";;", ";}"] ++ (map (\c -> " " ++ c) separators)
43+ stripSecond = or $ map (isOfPrefix str) $ map (\c -> c ++ " ") separators
44+ separators = [" ", "{", "}", ":", ";", ",", ">", "+", "!"]
4445
4546--------------------------------------------------------------------------------
4647-- | Compresses all whitespace.
@@ -50,7 +51,7 @@ compressWhitespace str
5051 | isConstant = head str : retainConstants compressWhitespace (head str) (drop 1 str)
5152 | replaceOne = compressWhitespace (' ' : (drop 1 str))
5253 | replaceTwo = compressWhitespace (' ' : (drop 2 str))
53− | otherwise = head str : compressWhitespace (drop 1 str)
54+ | otherwise = head str : compressWhitespace (drop 1 str)
5455 where
5556 isConstant = or $ map (isOfPrefix str) ["\"", "'"]
5657 replaceOne = or $ map (isOfPrefix str) ["\t", "\n", "\r"]
@@ -61,9 +62,9 @@ compressWhitespace str
6162stripComments :: String -> String
6263stripComments [] = []
6364stripComments str
64− | isConstant = head str : retainConstants stripComments (head str) (drop 1 str)
65+ | isConstant = head str : retainConstants stripComments (head str) (drop 1 str)
6566 | isPrefixOf "/*" str = stripComments $ eatComments $ drop 2 str
66− | otherwise = head str : stripComments (drop 1 str)
67+ | otherwise = head str : stripComments (drop 1 str)
6768 where
6869 isConstant = or $ map (isOfPrefix str) ["\"", "'"]
6970 eatComments str'