parse +tagsoup

parseOptions :: StringLike str => ParseOptions str
tagsoup Text.HTML.TagSoup
The default parse options value, described in ParseOptions. Equivalent to parseOptionsEntities lookupEntity.
parseOptionsEntities :: StringLike str => (str -> Maybe str) -> ParseOptions str
tagsoup Text.HTML.TagSoup
A ParseOptions structure using a custom function to lookup attributes. Any attribute that is not found will be left intact, and a TagWarning given (if optTagWarning is set). If you do not want to resolve any entities, simpliy pass const Nothing for the lookup function.
parseOptionsFast :: StringLike str => ParseOptions str
tagsoup Text.HTML.TagSoup
A ParseOptions structure optimised for speed, following the fast options.
parseTags :: StringLike str => str -> [Tag str]
tagsoup Text.HTML.TagSoup
Parse a string to a list of tags, using an HTML 5 compliant parser. > parseTags "<hello>my&amp;</world>" == [TagOpen "hello" [],TagText "my&",TagClose "world"]
parseTagsOptions :: StringLike str => ParseOptions str -> str -> [Tag str]
tagsoup Text.HTML.TagSoup
Parse a string to a list of tags, using settings supplied by the ParseOptions parameter, eg. to output position information: > parseTagsOptions parseOptions{optTagPosition = True} "<hello>my&amp;</world>" == > [TagPosition 1 1,TagOpen "hello" [],TagPosition 1 8,TagText "my&",TagPosition 1 15,TagClose "world"]
ParseOptions :: Bool -> Bool -> ((str, Bool) -> [Tag str]) -> ((str, Bool) -> (str, [Tag str])) -> Bool -> ParseOptions str
tagsoup Text.HTML.TagSoup
data ParseOptions str
tagsoup Text.HTML.TagSoup
These options control how parseTags works. The ParseOptions type is usually generated by one of parseOptions, parseOptionsFast or parseOptionsEntities, then selected fields may be overriden. The options optTagPosition and optTagWarning specify whether to generate TagPosition or TagWarning elements respectively. Usually these options should be set to False to simplify future stages, unless you rely on position information or want to give malformed HTML messages to the end user. The options optEntityData and optEntityAttrib control how entities, for example &nbsp; are handled. Both take a string, and a boolean, ended with a semi-colon ;. Inside normal text optEntityData will be called, and the results will be inserted in the tag stream. Inside a tag attribute optEntityAttrib will be called, and the first component of the result will be used in the attribute, and the second component will be appended after the TagOpen value (usually the second component is []). As an example, to not decode any entities, pass: > parseOptions > {optEntityData=\(str,b) -> [TagText $ "&" ++ str ++ [';' | b]] > ,optEntityAttrib\(str,b) -> ("&" ++ str ++ [';' | b], [])