|
|
|
|
|
Description |
The central type in TagSoup
|
|
Synopsis |
|
|
|
|
Data structures and parsing
|
|
|
A class to generalise TagSoup parsing over many types of string-like types.
Examples are given for the String type.
| | Instances | |
|
|
|
A single HTML element. A whole document is represented by a list of Tag.
There is no requirement for TagOpen and TagClose to match.
| Constructors | TagOpen str [Attribute str] | An open tag with Attributes in their original order
| TagClose str | A closing tag
| TagText str | A text node, guaranteed not to be the empty string
| TagComment str | A comment
| TagWarning str | Meta: A syntax error in the input file
| TagPosition !Row !Column | Meta: The position of a parsed element
|
| Instances | |
|
|
type Attribute str = (str, str) | Source |
|
An HTML attribute id="name" generates ("id","name")
|
|
|
The row/line of a position, starting at 1
|
|
|
The column of a position, starting at 1
|
|
Position manipulation
|
|
|
Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
Tag identification
|
|
|
Test if a Tag is a TagOpen
|
|
|
Test if a Tag is a TagClose
|
|
|
Test if a Tag is a TagText
|
|
|
Test if a Tag is a TagWarning
|
|
|
Test if a Tag is a TagPosition
|
|
|
Returns True if the Tag is TagOpen and matches the given name
|
|
|
Returns True if the Tag is TagClose and matches the given name
|
|
Extraction
|
|
|
Extract the string from within TagText, crashes if not a TagText
|
|
|
Extract an attribute, crashes if not a TagOpen.
Returns "" if no attribute present.
|
|
|
Extract the string from within TagText, otherwise Nothing
|
|
|
Extract the string from within TagWarning, otherwise Nothing
|
|
|
Extract all text content from tags (similar to Verbatim found in HaXml)
|
|
Produced by Haddock version 2.4.2 |