diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Hakyll/Web/CompressCss.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Hakyll/Web/CompressCss.hs b/src/Hakyll/Web/CompressCss.hs index 23adce2..6667842 100644 --- a/src/Hakyll/Web/CompressCss.hs +++ b/src/Hakyll/Web/CompressCss.hs @@ -52,7 +52,15 @@ compressWhitespace [] = [] compressWhitespace str | isPrefixOf "\"" str = head str : retainConstants compressWhitespace "\"" (drop 1 str) | isPrefixOf "'" str = head str : retainConstants compressWhitespace "'" (drop 1 str) - | otherwise = replaceAll "[ \t\n\r]+" (const " ") str + | isPrefixOf "\t" str = compressWhitespace (' ' : (drop 1 str)) + | isPrefixOf "\n" str = compressWhitespace (' ' : (drop 1 str)) + | isPrefixOf "\r" str = compressWhitespace (' ' : (drop 1 str)) + + | isPrefixOf " \t" str = compressWhitespace (' ' : (drop 2 str)) + | isPrefixOf " \n" str = compressWhitespace (' ' : (drop 2 str)) + | isPrefixOf " \r" str = compressWhitespace (' ' : (drop 2 str)) + | isPrefixOf " " str = compressWhitespace (' ' : (drop 2 str)) + | otherwise = head str : compressWhitespace (drop 1 str) -------------------------------------------------------------------------------- |