InternetLib

Html, HtmlItem, et al

HTML

Types

type Html = [HtmlItem]
data HtmlItem = HtmlChars String | HtmlContext HtmlTag Html | HtmlCommand HtmlTag | HtmlGarbage HtmlBadTag
  instance Eq HtmlItem
  instance Show HtmlItem
type HtmlTag = (TagName, TagAttrs)
type TagAttrs = [(String, String)]
type HtmlBadTag = (String, TagAttrs)

Description

Html is a data type for HTML documents.

An HTML document is a sequence of HTML items, represented by the type HtmlItem. An item is either some plain text (the constructor HtmlChars), an elements with some contents (the constructor HtmlContext), or an empty element (the constructor HtmlCommand).

See Also

HTML Tags: TagName.

Parsing and printing HTML: parseHtml, printHtml.

Constructing HTML: ctx, h1, img, etc.

Manipulation HTML: mapHtmlChars, et al.

Analysing HTML: extractTitle, htmlchars, et al.

Bugs

For historical reasons, the constructor names do not correspond exactly to the usual HTML terminology.

The type Html does not capture what a correct HTML document is. HTML elements can be mixed in arbitrary ways.


InternetLib