summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web
diff options
context:
space:
mode:
authorNicole Rauch <nicole.m@gmx.de>2016-08-14 19:51:45 +0200
committerNicole Rauch <nicole.m@gmx.de>2016-08-14 22:13:31 +0200
commite70605dfe681dbc0f79e0a8f426ac6c9fc9820a9 (patch)
tree061278f72d5b56b525bc2768f59934268e32c8a5 /src/Hakyll/Web
parent8f11bbd1d7cd81572ddc433aa1706bc2d2db4c8d (diff)
downloadhakyll-e70605dfe681dbc0f79e0a8f426ac6c9fc9820a9.tar.gz
We must avoid the compression of whitespace in constants by handling it in the same way.
Diffstat (limited to 'src/Hakyll/Web')
-rw-r--r--src/Hakyll/Web/CompressCss.hs10
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)
--------------------------------------------------------------------------------