@@ -52,16 +52,13 @@ compressWhitespace [] = []
52compressWhitespace str
52compressWhitespace str
53 | isPrefixOf "\"" str = head str : retainConstants compressWhitespace "\"" (drop 1 str)
53 | isPrefixOf "\"" str = head str : retainConstants compressWhitespace "\"" (drop 1 str)
54 | isPrefixOf "'" str = head str : retainConstants compressWhitespace "'" (drop 1 str)
54 | isPrefixOf "'" str = head str : retainConstants compressWhitespace "'" (drop 1 str)
55− | isPrefixOf "\t" str = compressWhitespace (' ' : (drop 1 str))
56− | isPrefixOf "\n" str = compressWhitespace (' ' : (drop 1 str))
57− | isPrefixOf "\r" str = compressWhitespace (' ' : (drop 1 str))
55+ | replaceOne = compressWhitespace (' ' : (drop 1 str))
59− | isPrefixOf " \t" str = compressWhitespace (' ' : (drop 2 str))
60− | isPrefixOf " \n" str = compressWhitespace (' ' : (drop 2 str))
61− | isPrefixOf " \r" str = compressWhitespace (' ' : (drop 2 str))
62− | isPrefixOf " " str = compressWhitespace (' ' : (drop 2 str))
56+ | replaceTwo = compressWhitespace (' ' : (drop 2 str))
63 | otherwise = head str : compressWhitespace (drop 1 str)
57 | otherwise = head str : compressWhitespace (drop 1 str)
59+ prefix p = isPrefixOf p str
60+ replaceOne = or $ map prefix ["\t", "\n", "\r"]
61+ replaceTwo = or $ map prefix [" \t", " \n", " \r", " "]
66--------------------------------------------------------------------------------
63--------------------------------------------------------------------------------
67-- | Function that strips CSS comments away.
64-- | Function that strips CSS comments away.