Text.XmlHtml.HTML.Meta

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

Safe Haskell | None
Language | Haskell98

Text.XmlHtml.HTML.Meta

Synopsis

- voidTags :: HashSet Text
- rawTextTags :: HashSet Text
- isRawText :: Text -> [(Text, Text)] -> Bool
- endOmittableLast :: HashSet Text
- endOmittableNext :: HashMap Text (HashSet Text)
- predefinedRefs :: HashMap Text Text

# Documentation

voidTags :: HashSet Text

Void elements as defined by the HTML5 spec.

rawTextTags :: HashSet Text

Elements that XmlHtml treats as raw text by default. Raw text elements are not allowed to have any other tags in them. This is necessary to support the Javascript less than operator inside a script tag, for example.

The library uses the `isRawText` function everywhere instead of checking this set directly because that gives us an escape hatch to avoid the default behavior if necessary.

isRawText :: Text -> [(Text, Text)] -> Bool

Determine whether a tag should be treated as raw text. Raw text elements are not allowed to have any other tags in them. This is necessary to support the Javascript less than operator inside a script tag, for example.

If a tag is in the `rawTextTags` set, this function allows you to override that behavior by adding the `xmlhtmlNotRaw` attribute. Conversely, if a tag is not in the `rawTextTags` set, this function allows you to override that by adding the `xmlhtmlRaw` attribute to the tag.

This is the function that is actually used in the parser and renderer. `rawTextTags` is not used any more, but is still provided for backwards compatibility and to let you see which tags are treated as raw by default.

endOmittableLast :: HashSet Text

List of elements with omittable end tags.

endOmittableNext :: HashMap Text (HashSet Text)

Tags which should be considered automatically ended in case one of a certain set of tags pops up.

predefinedRefs :: HashMap Text Text

Predefined character entity references as defined by the HTML5 spec.