Parse html to Text.Blaze.Html

382 Views Asked by At

I'm trying to parse an html file to the Text.Blaze.Html type using Text.Pandoc. The html I'll be attempting to parse is:

<head>

 <style type="text/css">table.sourceCode {
 margin: 0; padding: 0; vertical-align: baseline; border: none; }
 table.sourceCode { width: 100%; line-height: 100%; background-color: #f8f8f8; }
 </style>

 <title>Using Yesod</title>

 </head>

 <body>
   <h1>Intial Commit</h1>
   <br>
 </body>

The code I use is:

writeHtml def {writerHtml5 = True } . readHtml def $ inp

This strips the header tags off and yields only the body giving:

Main > renderHtml $ writeHtml def > {writerHtml5 = True } . readHtml def $ inp
"<h1>Intial Commit</h1>\n<p><br /></p>"

I understand the header content is stored as meta-data, but I want to know where the rest of the Header content (the style information goes in this case) goes.

Main > readHtml def ht
Pandoc (Meta {unMeta = fromList [("title",MetaInlines [Str "Using",Space,Str   "Yesod"])]}) > [Header 1 ("",[],[]) [Str "Intial",Space,Str "Commit"],Para [LineBreak]]
0

There are 0 best solutions below