| |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
Description | |||||||||||||||||||||||||||||||||||||
The central type in TagSoup | |||||||||||||||||||||||||||||||||||||
Synopsis | |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
Data structures and parsing | |||||||||||||||||||||||||||||||||||||
data Tag | |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
type Attribute = (String, String) | |||||||||||||||||||||||||||||||||||||
An HTML attribute id="name" generates ("id","name") | |||||||||||||||||||||||||||||||||||||
type Row = Int | |||||||||||||||||||||||||||||||||||||
type Column = Int | |||||||||||||||||||||||||||||||||||||
Tag identification | |||||||||||||||||||||||||||||||||||||
isTagOpen :: Tag -> Bool | |||||||||||||||||||||||||||||||||||||
Test if a Tag is a TagOpen | |||||||||||||||||||||||||||||||||||||
isTagClose :: Tag -> Bool | |||||||||||||||||||||||||||||||||||||
Test if a Tag is a TagClose | |||||||||||||||||||||||||||||||||||||
isTagText :: Tag -> Bool | |||||||||||||||||||||||||||||||||||||
Test if a Tag is a TagText | |||||||||||||||||||||||||||||||||||||
isTagWarning :: Tag -> Bool | |||||||||||||||||||||||||||||||||||||
Test if a Tag is a TagWarning | |||||||||||||||||||||||||||||||||||||
isTagOpenName :: String -> Tag -> Bool | |||||||||||||||||||||||||||||||||||||
Returns True if the Tag is TagOpen and matches the given name | |||||||||||||||||||||||||||||||||||||
isTagCloseName :: String -> Tag -> Bool | |||||||||||||||||||||||||||||||||||||
Returns True if the Tag is TagClose and matches the given name | |||||||||||||||||||||||||||||||||||||
Extraction | |||||||||||||||||||||||||||||||||||||
fromTagText :: Tag -> String | |||||||||||||||||||||||||||||||||||||
Extract the string from within TagText, crashes if not a TagText | |||||||||||||||||||||||||||||||||||||
fromAttrib :: String -> Tag -> String | |||||||||||||||||||||||||||||||||||||
Extract an attribute, crashes if not a TagOpen. Returns "" if no attribute present. | |||||||||||||||||||||||||||||||||||||
maybeTagText :: Tag -> Maybe String | |||||||||||||||||||||||||||||||||||||
Extract the string from within TagText, otherwise Nothing | |||||||||||||||||||||||||||||||||||||
maybeTagWarning :: Tag -> Maybe String | |||||||||||||||||||||||||||||||||||||
Extract the string from within TagWarning, otherwise Nothing | |||||||||||||||||||||||||||||||||||||
innerText :: [Tag] -> String | |||||||||||||||||||||||||||||||||||||
Extract all text content from tags (similar to Verbatim found in HaXml) | |||||||||||||||||||||||||||||||||||||
Produced by Haddock version 0.8 |