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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Text.XmlHtml.HTML.Meta

Synopsis

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

# Documentation

voidTags :: HashSet Text Source #

Void elements as defined by the HTML5 spec.

rawTextTags :: HashSet Text Source #

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 Source #

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 Source #

List of elements with omittable end tags.

endOmittableNext :: HashMap Text (HashSet Text) Source #

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

explicitAttributes :: HashMap Text (HashSet Text) Source #

Tags and attributes which should always be rendered with an explicit value, even when the value is empty. This is required by some web browsers for tags that are typically non-empty.

predefinedRefs :: Map Text Text Source #

Predefined character entity references as defined by the HTML5 spec.

reversePredefinedRefs :: Map Text Text Source #

Reverse lookup of Html entities. The values in this map should be the "canonical" entity names that are most widely support by browsers, email clients, etc. If you encounter a situation where the value in this map is not the most widely supported, please open a pull request to change the order in the appropriate ent2names table below.