tagsoup-0.7: Parsing and extracting information from (possibly malformed) HTML documentsContentsIndex
Text.HTML.TagSoup.Entity
Synopsis
lookupEntity :: String -> Maybe Char
lookupNamedEntity :: String -> Maybe Char
lookupNumericEntity :: String -> Maybe Char
escapeXMLChar :: Char -> Maybe String
xmlEntities :: [(String, Int)]
htmlEntities :: [(String, Int)]
Documentation
lookupEntity :: String -> Maybe Char
Lookup an entity, using lookupNumericEntity if it starts with # and lookupNamedEntity otherwise
lookupNamedEntity :: String -> Maybe Char

Lookup a named entity, using htmlEntities

 lookupNamedEntity "amp" == Just '&'
 lookupNamedEntity "haskell" == Nothing
lookupNumericEntity :: String -> Maybe Char

Lookup 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 "Haskell" == Nothing
 lookupNumericEntity "" == Nothing
 lookupNumericEntity "89439085908539082" == Nothing
escapeXMLChar :: Char -> Maybe String

Escape a character before writing it out to XML.

 escapeXMLChar 'a' == Nothing
 escapeXMLChar '&' == Just "amp"
xmlEntities :: [(String, Int)]
A table mapping XML entity names to code points. Does not include apos as Internet Explorer does not know about it.
htmlEntities :: [(String, Int)]
A table mapping HTML entity names to code points
Produced by Haddock version 0.8