@@ -52,16 +52,13 @@ compressWhitespace [] = []
5252compressWhitespace str
5353 | isPrefixOf "\"" str = head str : retainConstants compressWhitespace "\"" (drop 1 str)
5454 | 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))
58−
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))
55+ | replaceOne = compressWhitespace (' ' : (drop 1 str))
56+ | replaceTwo = compressWhitespace (' ' : (drop 2 str))
6357 | otherwise = head str : compressWhitespace (drop 1 str)
64−
58+ where
59+ prefix p = isPrefixOf p str
60+ replaceOne = or $ map prefix ["\t", "\n", "\r"]
61+ replaceTwo = or $ map prefix [" \t", " \n", " \r", " "]
6562
6663--------------------------------------------------------------------------------
6764-- | Function that strips CSS comments away.