tagchup-0.4.0.6: alternative package for processing of tag soups

Safe HaskellSafe
LanguageHaskell98

Text.HTML.Tagchup.Parser

Description

Parse a string into our custom tag soup data structure.

The parser works only on proper Unicode texts. That is, you must have decoded it before, e.g. using decoding functions from hxt or encoding package. findMetaEncoding can assist you retrieving the character set encoding from meta information of the document at hand.

Synopsis

Documentation

class C char => CharType char Source #

Minimal complete definition

parseChar, parseUnquotedValue

Instances

CharType Char Source # 

Methods

parseChar :: C source => (Char -> Bool) -> Parser source [Char]

parseUnquotedValue :: C source => ParserEmit source [Char]

CharType T Source # 

Methods

parseChar :: C source => (Char -> Bool) -> Parser source [T]

parseUnquotedValue :: C source => ParserEmit source [T]

runSoup :: (C source, StringType sink, Attribute name, Tag name) => source -> [T name sink] Source #

Like runSoupWithPositions but hides source file positions.

runSoupWithPositions :: (C source, StringType sink, Attribute name, Tag name) => source -> [T name sink] Source #

Parse an HTML document to a list of T. Automatically expands out escape characters.

runSoupWithPositionsName :: (C source, StringType sink, Attribute name, Tag name) => FilePath -> source -> [T name sink] Source #

runTag :: (C source, StringType sink, Show sink, Attribute name, Tag name, Show name) => source -> T name sink Source #

Parse a single tag, throws an error if there is a syntax error. This is useful for parsing a match pattern.

runInnerOfTag :: (StringType sink, Show sink, Attribute name, Tag name, Show name) => String -> T name sink Source #

Parse the inner of a single tag. That is, runTag "<bla>" is the same as runInnerOfTag "bla".