diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-12-27 10:12:19 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-12-27 10:12:19 +0100 |
commit | d25dcb698e37765f35edf4c6e9b38e1d9dbb578e (patch) | |
tree | 2970fc00879b809b302bd98150920989e685c34b /src/Hakyll/Web/Page | |
parent | c1d16cdab337274a9f5aca40b887371ca1a1f5a1 (diff) | |
download | hakyll-d25dcb698e37765f35edf4c6e9b38e1d9dbb578e.tar.gz |
Fix typo in comments
Diffstat (limited to 'src/Hakyll/Web/Page')
-rw-r--r-- | src/Hakyll/Web/Page/Read.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Hakyll/Web/Page/Read.hs b/src/Hakyll/Web/Page/Read.hs index f840eba..c886fab 100644 --- a/src/Hakyll/Web/Page/Read.hs +++ b/src/Hakyll/Web/Page/Read.hs @@ -18,11 +18,6 @@ import Hakyll.Web.Util.String -- type LineParser = State [String] --- | Check if the given string is a metadata delimiter. --- -isPossibleDelimiter :: String -> Bool -isPossibleDelimiter = isPrefixOf "---" - -- | Read the metadata section from a page -- parseMetadata :: LineParser (Map String String) @@ -31,7 +26,7 @@ parseMetadata = get >>= \content -> case content of [] -> return M.empty -- Check if the file begins with a delimiter (l : ls) -> if not (isPossibleDelimiter l) - then -- No delimiter means no body + then -- No delimiter means no metadata return M.empty else do -- Break the metadata section let (metadata, rest) = second (drop 1) $ break (== l) ls @@ -40,7 +35,10 @@ parseMetadata = get >>= \content -> case content of -- Parse the metadata return $ M.fromList $ map parseMetadata' metadata where - parseMetadata' :: String -> (String, String) + -- Check if a line can be a delimiter + isPossibleDelimiter = isPrefixOf "---" + + -- Parse a "key: value" string to a (key, value) tupple parseMetadata' = (trim *** trim . drop 1) . break (== ':') -- | Read the body section of a page |