@@ -8,6 +8,7 @@ module Text.Hakyll.Page
9import qualified Data.Map as M
9import qualified Data.Map as M
10import qualified Data.List as L
10import qualified Data.List as L
11+import Data.Char (isSpace)
11import Data.Maybe (fromMaybe)
12import Data.Maybe (fromMaybe)
12import Control.Parallel.Strategies (rdeepseq, ($|))
13import Control.Parallel.Strategies (rdeepseq, ($|))
13import Control.Monad.Reader (liftIO)
14import Control.Monad.Reader (liftIO)
@@ -121,16 +122,16 @@ readSection renderFunction isFirst ls
121 | otherwise = body (tail ls)
122 | otherwise = body (tail ls)
123 isDelimiter' = isDelimiter (head ls)
124 isDelimiter' = isDelimiter (head ls)
124− isNamedDelimiter = head ls `matchesRegex` "----* *[a-zA-Z][a-zA-Z]*"
125+ isNamedDelimiter = head ls `matchesRegex` "----* *[a-zA-Z0-9][a-zA-Z0-9]*"
125 body ls' = [("body", renderFunction $ unlines ls')]
126 body ls' = [("body", renderFunction $ unlines ls')]
127− readSimpleMetaData = map readPair
128+ readSimpleMetaData = map readPair . filter (not . all isSpace)
128 readPair = trimPair . break (== ':')
129 readPair = trimPair . break (== ':')
129 trimPair (key, value) = (trim key, trim $ tail value)
130 trimPair (key, value) = (trim key, trim $ tail value)
131 readSectionMetaData [] = []
132 readSectionMetaData [] = []
132 readSectionMetaData (header:value) =
133 readSectionMetaData (header:value) =
133− let key = substituteRegex "[^a-zA-Z]" "" header
134+ let key = substituteRegex "[^a-zA-Z0-9]" "" header
134 in [(key, renderFunction $ unlines value)]
135 in [(key, renderFunction $ unlines value)]
136-- | Read a page from a file. Metadata is supported, and if the filename
137-- | Read a page from a file. Metadata is supported, and if the filename