on master help sign in
Fix typo in comments
commitd25dcb698e37765f35edf4c6e9b38e1d9dbb578e authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 27 Dec 2010, 10:12 (16 years ago) parentc1d16cd
1 file changed+5−7
src/Hakyll/Web/Page/Read.hs+5−7
src/Hakyll/Web/Page/Read.hs+5−7
@@ -18,11 +18,6 @@ import Hakyll.Web.Util.String
1818--
1919type LineParser = State [String]
2020
21−-- | Check if the given string is a metadata delimiter.
22−--
23−isPossibleDelimiter :: String -> Bool
24−isPossibleDelimiter = isPrefixOf "---"
25−
2621-- | Read the metadata section from a page
2722--
2823parseMetadata :: LineParser (Map String String)
@@ -31,7 +26,7 @@ parseMetadata = get >>= \content -> case content of
3126 [] -> return M.empty
3227 -- Check if the file begins with a delimiter
3328 (l : ls) -> if not (isPossibleDelimiter l)
34− then -- No delimiter means no body
29+ then -- No delimiter means no metadata
3530 return M.empty
3631 else do -- Break the metadata section
3732 let (metadata, rest) = second (drop 1) $ break (== l) ls
@@ -40,7 +35,10 @@ parseMetadata = get >>= \content -> case content of
4035 -- Parse the metadata
4136 return $ M.fromList $ map parseMetadata' metadata
4237 where
43− parseMetadata' :: String -> (String, String)
38+ -- Check if a line can be a delimiter
39+ isPossibleDelimiter = isPrefixOf "---"
40+
41+ -- Parse a "key: value" string to a (key, value) tupple
4442 parseMetadata' = (trim *** trim . drop 1) . break (== ':')
4543
4644-- | Read the body section of a page