@@ -7,8 +7,8 @@
8module Text.HTML.Parser
8module Text.HTML.Parser
9 ( -- * Parsing
9 ( -- * Parsing
11− , tagStream
11+ , token
12 -- * Types
12 -- * Types
13 , Token(..)
13 , Token(..)
14 , TagName, AttrName, AttrValue
14 , TagName, AttrName, AttrValue
@@ -41,13 +41,14 @@ type AttrValue = Text
42-- | An HTML token
42-- | An HTML token
44− -- | An opening tag. Attribute ordering is arbitrary
44+ -- | An opening tag. Attribute ordering is arbitrary.
45 = TagOpen !TagName [Attr]
45 = TagOpen !TagName [Attr]
46 -- | A closing tag.
46 -- | A closing tag.
47 | TagClose !TagName
47 | TagClose !TagName
48 -- | The content between tags.
48 -- | The content between tags.
50 | ContentText !Text
49 | ContentText !Text
50+ -- | A single character of content
51 -- | Contents of a comment.
52 -- | Contents of a comment.
52 | Comment !Builder
53 | Comment !Builder
53 -- | Doctype
54 -- | Doctype
@@ -245,9 +246,9 @@ doctype = do
245bogusComment :: Parser Token
246bogusComment :: Parser Token
246bogusComment = fail "Bogus comment"
247bogusComment = fail "Bogus comment"
248−-- | Produce a lazy list of tokens.
249+-- | Parse a lazy list of tokens.
249−tagStream :: Text -> [Token]
250+parseTokens :: Text -> [Token]
250−tagStream = unfoldr f
251+parseTokens = unfoldr f
252 f :: Text -> Maybe (Token, Text)
253 f :: Text -> Maybe (Token, Text)