diff options
Diffstat (limited to 'src/Text/Hakyll/Internal')
-rw-r--r-- | src/Text/Hakyll/Internal/CompressCss.hs | 4 | ||||
-rw-r--r-- | src/Text/Hakyll/Internal/Page.hs | 6 | ||||
-rw-r--r-- | src/Text/Hakyll/Internal/Template.hs | 6 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/Text/Hakyll/Internal/CompressCss.hs b/src/Text/Hakyll/Internal/CompressCss.hs index 4b19984..4a78791 100644 --- a/src/Text/Hakyll/Internal/CompressCss.hs +++ b/src/Text/Hakyll/Internal/CompressCss.hs @@ -29,8 +29,8 @@ stripComments :: String -> String stripComments [] = [] stripComments str | isPrefixOf "/*" str = stripComments $ eatComments $ drop 2 str - | otherwise = head str : stripComments (tail str) + | otherwise = head str : stripComments (drop 1 str) where eatComments str' | null str' = [] | isPrefixOf "*/" str' = drop 2 str' - | otherwise = eatComments $ tail str' + | otherwise = eatComments $ drop 1 str' diff --git a/src/Text/Hakyll/Internal/Page.hs b/src/Text/Hakyll/Internal/Page.hs index 59bae65..92fb4fc 100644 --- a/src/Text/Hakyll/Internal/Page.hs +++ b/src/Text/Hakyll/Internal/Page.hs @@ -71,8 +71,8 @@ readSection _ _ [] = [] readSection renderFunction isFirst ls | not isDelimiter' = body ls | isNamedDelimiter = readSectionMetaData ls - | isFirst = readSimpleMetaData (tail ls) - | otherwise = body (tail ls) + | isFirst = readSimpleMetaData (drop 1 ls) + | otherwise = body (drop 1 ls) where isDelimiter' = isPossibleDelimiter (head ls) isNamedDelimiter = head ls `matchesRegex` "^----* *[a-zA-Z0-9][a-zA-Z0-9]*" @@ -80,7 +80,7 @@ readSection renderFunction isFirst ls readSimpleMetaData = map readPair . filter (not . all isSpace) readPair = trimPair . break (== ':') - trimPair (key, value) = (trim key, trim $ tail value) + trimPair (key, value) = (trim key, trim $ drop 1 value) readSectionMetaData [] = [] readSectionMetaData (header:value) = diff --git a/src/Text/Hakyll/Internal/Template.hs b/src/Text/Hakyll/Internal/Template.hs index bd9121b..15a2c8c 100644 --- a/src/Text/Hakyll/Internal/Template.hs +++ b/src/Text/Hakyll/Internal/Template.hs @@ -29,15 +29,13 @@ fromString = Template . fromString' fromString' [] = [] fromString' string | "$$" `isPrefixOf` string = - EscapeCharacter : (fromString' $ tail tail') + EscapeCharacter : (fromString' $ drop 2 string) | "$" `isPrefixOf` string = - let (key, rest) = span isAlphaNum tail' + let (key, rest) = span isAlphaNum $ drop 1 string in Identifier key : fromString' rest | otherwise = let (chunk, rest) = break (== '$') string in Chunk chunk : fromString' rest - where - tail' = tail string -- | Read a @Template@ from a file. This function might fetch the @Template@ -- from the cache, if available. |