@@ -8,6 +8,7 @@ module Text.Hakyll.Page
88
99import qualified Data.Map as M
1010import qualified Data.List as L
11+import Data.Char (isSpace)
1112import Data.Maybe (fromMaybe)
1213import Control.Parallel.Strategies (rdeepseq, ($|))
1314import Control.Monad.Reader (liftIO)
@@ -121,16 +122,16 @@ readSection renderFunction isFirst ls
121122 | otherwise = body (tail ls)
122123 where
123124 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]*"
125126 body ls' = [("body", renderFunction $ unlines ls')]
126127
127− readSimpleMetaData = map readPair
128+ readSimpleMetaData = map readPair . filter (not . all isSpace)
128129 readPair = trimPair . break (== ':')
129130 trimPair (key, value) = (trim key, trim $ tail value)
130131
131132 readSectionMetaData [] = []
132133 readSectionMetaData (header:value) =
133− let key = substituteRegex "[^a-zA-Z]" "" header
134+ let key = substituteRegex "[^a-zA-Z0-9]" "" header
134135 in [(key, renderFunction $ unlines value)]
135136
136137-- | Read a page from a file. Metadata is supported, and if the filename