diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-01-02 10:22:49 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-01-02 10:22:49 +0100 |
commit | 2d1225104cb5a050a84bc70916e1aadfff25fb00 (patch) | |
tree | 7d806948d01c5a0c91406784bd7fca7dcd1e813d /src/Hakyll/Web/CompressCss.hs | |
parent | e1aa9600993363eec55425bc05cb9813b9054f91 (diff) | |
download | hakyll-2d1225104cb5a050a84bc70916e1aadfff25fb00.tar.gz |
Add toUrl, move & optimize replaceAll a bit
Diffstat (limited to 'src/Hakyll/Web/CompressCss.hs')
-rw-r--r-- | src/Hakyll/Web/CompressCss.hs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/Hakyll/Web/CompressCss.hs b/src/Hakyll/Web/CompressCss.hs index cd03237..6e3b6f2 100644 --- a/src/Hakyll/Web/CompressCss.hs +++ b/src/Hakyll/Web/CompressCss.hs @@ -6,23 +6,9 @@ module Text.Hakyll.Internal.CompressCss ) where import Data.Char (isSpace) -import Data.Maybe (listToMaybe) import Data.List (isPrefixOf) -import Text.Regex.Posix ((=~~)) --- | A simple (but inefficient) regex replace funcion --- -replaceAll :: String -- ^ Pattern - -> (String -> String) -- ^ Replacement (called on capture) - -> String -- ^ Source string - -> String -- ^ Result -replaceAll pattern f source = - case listToMaybe (source =~~ pattern) of - Nothing -> source - Just (o, l) -> - let (before, tmp) = splitAt o source - (capture, after) = splitAt l tmp - in before ++ f capture ++ replaceAll pattern f after +import Hakyll.Web.Util.String -- | Compress CSS to speed up your site. -- |