@@ -132,28 +132,27 @@ inlinesInBalancedBrackets parser = try $ do
132132titleLine :: GenParser Char ParserState [Inline]
133133titleLine = try $ char '%' >> skipSpaces >> manyTill inline newline
134134
135−authorsLine :: GenParser Char st [String]
135+authorsLine :: GenParser Char ParserState [[Inline]]
136136authorsLine = try $ do
137137 char '%'
138138 skipSpaces
139− authors <- sepEndBy (many1 (noneOf ",;\n")) (oneOf ",;")
139+ authors <- sepEndBy (many1 (notFollowedBy (oneOf ",;\n") >> inline)) (oneOf ",;")
140140 newline
141− return $ map (decodeCharacterReferences . removeLeadingTrailingSpace) authors
141+ return $ map normalizeSpaces authors
142142
143−dateLine :: GenParser Char st String
143+dateLine :: GenParser Char ParserState [Inline]
144144dateLine = try $ do
145145 char '%'
146146 skipSpaces
147− date <- many (noneOf "\n")
148− newline
149− return $ decodeCharacterReferences $ removeTrailingSpace date
147+ date <- manyTill inline newline
148+ return $ normalizeSpaces date
150149
151−titleBlock :: GenParser Char ParserState ([Inline], [String], [Char])
150+titleBlock :: GenParser Char ParserState ([Inline], [[Inline]], [Inline])
152151titleBlock = try $ do
153152 failIfStrict
154153 title <- option [] titleLine
155154 author <- option [] authorsLine
156− date <- option "" dateLine
155+ date <- option [] dateLine
157156 optional blanklines
158157 return (title, author, date)
159158
@@ -175,7 +174,7 @@ parseMarkdown = do
175174 let reversedNotes = stateNotes st'
176175 updateState $ \s -> s { stateNotes = reverse reversedNotes }
177176 -- now parse it for real...
178− (title, author, date) <- option ([],[],"") titleBlock
177+ (title, author, date) <- option ([],[],[]) titleBlock
179178 blocks <- parseBlocks
180179 return $ Pandoc (Meta title author date) $ filter (/= Null) blocks
181180