Lookup an entity, using lookupNumericEntity if it starts with
# and lookupNamedEntity otherwise
Moduletagsoup-0.14.8Haskell2010
Text.HTML.TagSoup.Entity
This module converts between HTML/XML entities (i.e. &) and
the characters they represent.
- 6 values
- Packagetagsoup-0.14.8
- Exports6
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceEntity.hs
Lookup a named entity, using htmlEntities
lookupNamedEntity "amp" == Just "&"
lookupNamedEntity "haskell" == NothingLookup a numeric entity, the leading '#' must have already been removed.
lookupNumericEntity "65" == Just "A"
lookupNumericEntity "x41" == Just "A"
lookupNumericEntity "x4E" === Just "N"
lookupNumericEntity "x4e" === Just "N"
lookupNumericEntity "X4e" === Just "N"
lookupNumericEntity "Haskell" == Nothing
lookupNumericEntity "" == Nothing
lookupNumericEntity "89439085908539082" == NothingEscape an XML string.
escapeXML "hello world" == "hello world"
escapeXML "hello & world" == "hello & world"A table mapping XML entity names to resolved strings. All strings are a single character long.
A table mapping HTML entity names to resolved strings. Most resolved strings are a single character long,
but some (e.g. "ngeqq") are two characters long. The list is taken from
http://www.w3.org/TR/html5/syntax.html#named-character-references.