From 3ec8772daff7d76097d7435c4e8da1df5ee4cc6a Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 31 Dec 2009 01:12:44 +0000 Subject: Changed Meta author and date types to Inline lists instead of Strings. Meta [Inline] [[Inline]] [Inline] rather than Meta [Inline] [String] String. This is a breaking change for libraries that use pandoc and manipulate the metadata. Changed .native files in test suite for new Meta format. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1699 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/HTML.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/Readers/HTML.hs') diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index e6ca05d87..94cde2d8d 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -382,7 +382,7 @@ parseTitle = try $ do return contents -- parse header and return meta-information (for now, just title) -parseHead :: GenParser Char ParserState ([Inline], [a], [Char]) +parseHead :: GenParser Char ParserState Meta parseHead = try $ do htmlTag "head" spaces @@ -390,7 +390,7 @@ parseHead = try $ do contents <- option [] parseTitle skipMany nonTitleNonHead htmlEndTag "head" - return (contents, [], "") + return $ Meta contents [] [] skipHtmlTag :: String -> GenParser Char ParserState () skipHtmlTag tag = optional (htmlTag tag) @@ -409,7 +409,7 @@ parseHtml = do sepEndBy (choice [xmlDec, definition, htmlComment]) spaces skipHtmlTag "html" spaces - (title, authors, date) <- option ([], [], "") parseHead + meta <- option (Meta [] [] []) parseHead spaces skipHtmlTag "body" spaces @@ -420,7 +420,7 @@ parseHtml = do spaces optional (htmlEndTag "html" >> many anyChar) -- ignore anything after eof - return $ Pandoc (Meta title authors date) blocks + return $ Pandoc meta blocks -- -- parsing blocks -- cgit v1.2.3