xmlhtml-0.1.7: XML parser and renderer with HTML 5 quirks mode

Safe HaskellSafe-Infered

Text.XmlHtml.HTML.Render

Synopsis

Documentation

render :: Encoding -> Maybe DocType -> [Node] -> BuilderSource

And, the rendering code.

renderHtmlFragment :: Encoding -> [Node] -> BuilderSource

Function for rendering HTML nodes without the overhead of creating a Document structure.

escaped :: [Char] -> Encoding -> Text -> BuilderSource

HTML allows & so long as it is not ambiguous (i.e., looks like an entity). So we have a special case for that.

firstNode :: Encoding -> Node -> BuilderSource

Process the first node differently to encode leading whitespace. This lets us be sure that parseHTML is a left inverse to render.

element :: Encoding -> Text -> Text -> [(Text, Text)] -> [Node] -> BuilderSource