caa740336010fe5d1fc21df6ae3ece5c44a845c2
[dead/lwn-epub.git] / src / LWN / XHTML.hs
1 module LWN.XHTML (
2 XHTML,
3 parse_lwn,
4 to_xhtml
5 )
6 where
7
8 import Text.XML.HXT.Core (
9 IOStateArrow,
10 SysConfigList,
11 XmlTree,
12 no,
13 readString,
14 withParseHTML,
15 withValidate,
16 withWarnings,
17 yes
18 )
19
20 class XHTML a where
21 to_xhtml :: a -> String
22
23
24
25 -- | Options used when parsing HTML.
26 my_read_opts :: SysConfigList
27 my_read_opts = [ withValidate no,
28 withParseHTML yes,
29 withWarnings no ]
30
31 -- | My version of HandsomeSoup's parseHTML.
32 parse_lwn :: String -> IOStateArrow s b XmlTree
33 parse_lwn = readString my_read_opts