git.iko.soy/typeable/html-parse
on master help sign in
Ensure partial results are produced

Fixes #2.

commit717224cedd9252b02d695633be08b4be19316f87 authorBen Gamari <ben@smart-cactus.org> dateWed 23 Nov 2016, 11:54 (10 years ago) parenta34cdf7
1 file changed+4
Text/HTML/Parser.hs+4
Text/HTML/Parser.hs+4
@@ -260,6 +260,10 @@ parseTokens = unfoldr f
260260 | otherwise =
261261 case parse token t of
262262 Done rest tok -> Just (tok, rest)
263+ Partial cont ->
264+ case cont mempty of
265+ Done rest tok -> Just (tok, rest)
266+ _ -> Nothing
263267 _ -> Nothing
264268
265269-- | Parse a lazy list of tokens from lazy 'TL.Text'.