"<?xml version=\"1.0\" encoding=\"utf-8\" ?>" ++
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"" ++
"\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">" ++
- "\n<head>\n" ++
+ "<head>" ++
" <meta http-equiv=\"Content-Type\"" ++
" content=\"application/xhtml+xml; charset=utf-8\" />" ++
- " <title>" ++ (LWN.Article.title a) ++ "</title>\n" ++
- "</head>\n" ++
- "<body>\n" ++
- "<div>\n\n" ++
+ " <title>" ++ (show $ LWN.Article.title a) ++ "</title>" ++
+ "</head>" ++
+ "<body>" ++
+ "<div>" ++
(to_xhtml a) ++
- "\n\n</div>\n" ++
- "\n</body>\n" ++
+ "</div>" ++
+ "</body>" ++
"</html>"
Just [x] -> return $ Just $ ArticlePage x
_ -> return Nothing
- title (ArticlePage x) = LWN.Article.title x
+ title (ArticlePage x) = show $ LWN.Article.title x
-- | Takes data from an LWN page and determines whether or not it's a
parsed_headline <- parse_headline xml
parsed_byline <- parse_byline xml
parsed_body <- parse_body xml
- let title' = fromJust parsed_headline
- let byline' = fromJust parsed_byline
- let body' = fromJust parsed_body
+ let title' = Title (fromJust parsed_headline)
+ let byline' = Byline parsed_byline
+ let body' = BodyHtml (fromJust parsed_body)
return $ Just $ [Article title' byline' body']