X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Flwn-epub.git;a=blobdiff_plain;f=src%2FLWN%2FXHTML.hs;fp=src%2FLWN%2FXHTML.hs;h=caa740336010fe5d1fc21df6ae3ece5c44a845c2;hp=0000000000000000000000000000000000000000;hb=f3321e2ce7d7645ad562dc8f6620bfd561edc75d;hpb=96249c993a34237c6e6df772eb36858e70ce9b34 diff --git a/src/LWN/XHTML.hs b/src/LWN/XHTML.hs new file mode 100644 index 0000000..caa7403 --- /dev/null +++ b/src/LWN/XHTML.hs @@ -0,0 +1,33 @@ +module LWN.XHTML ( + XHTML, + parse_lwn, + to_xhtml + ) +where + +import Text.XML.HXT.Core ( + IOStateArrow, + SysConfigList, + XmlTree, + no, + readString, + withParseHTML, + withValidate, + withWarnings, + yes + ) + +class XHTML a where + to_xhtml :: a -> String + + + +-- | Options used when parsing HTML. +my_read_opts :: SysConfigList +my_read_opts = [ withValidate no, + withParseHTML yes, + withWarnings no ] + +-- | My version of HandsomeSoup's parseHTML. +parse_lwn :: String -> IOStateArrow s b XmlTree +parse_lwn = readString my_read_opts