- type Attribute char = (String, [char])
- data T char
- data Processing char
- = KnownProcessing [Attribute char]
- | UnknownProcessing String
- isOpen :: T char -> Bool
- maybeOpen :: T char -> Maybe (String, [Attribute char])
- isClose :: T char -> Bool
- maybeClose :: T char -> Maybe String
- isText :: T char -> Bool
- maybeText :: T char -> Maybe [char]
- innerText :: [T char] -> [char]
- isComment :: T char -> Bool
- maybeComment :: T char -> Maybe String
- isSpecial :: T char -> Bool
- maybeSpecial :: T char -> Maybe (String, String)
- isProcessing :: T char -> Bool
- maybeProcessing :: T char -> Maybe (String, Processing char)
- isWarning :: T char -> Bool
- maybeWarning :: T char -> Maybe String
- canonicalizeSoup :: [T char] -> [T char]
- canonicalize :: T char -> T char
- textFromCData :: T Char -> T Char
type definitions
An HTML element, a document is [T]
.
There is no requirement for Open
and Close
to match.
The type parameter char
lets you choose between
Char
for interpreted HTML entity references and
HTMLChar.T
for uninterpreted HTML entity.
You will most oftenly want plain Char
,
since HTMLChar.T
is only necessary if you want to know,
whether a non-ASCII character was encoded as HTML entity
or as non-ASCII Unicode character.
Open String [Attribute char] | An open tag with |
Close String | A closing tag |
Text [char] | A text node, guaranteed not to be the empty string |
Comment String | A comment |
Special String String | A tag like |
Processing String (Processing char) | A tag like |
Warning String | Mark a syntax error in the input file |
data Processing char Source
Eq char => Eq (Processing char) | |
Ord char => Ord (Processing char) | |
Show char => Show (Processing char) |
check for certain tag types
maybeClose :: T char -> Maybe StringSource
innerText :: [T char] -> [char]Source
Extract all text content from tags (similar to Verbatim found in HaXml)
maybeComment :: T char -> Maybe StringSource
isProcessing :: T char -> BoolSource
maybeProcessing :: T char -> Maybe (String, Processing char)Source
maybeWarning :: T char -> Maybe StringSource
tag processing
canonicalizeSoup :: [T char] -> [T char]Source
canonicalize :: T char -> T charSource
Turns all tag names to lower case and converts DOCTYPE to upper case.