Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update to conduit 0.2.0

  • Loading branch information...
commit 0d963bde2a6c5cbec2cb6fad496a8dea5d3014d9 1 parent bd9d97f
@yihuang authored
Showing with 5 additions and 7 deletions.
  1. +3 −5 Text/HTML/TagStream/Stream.hs
  2. +2 −2 tagstream-conduit.cabal
View
8 Text/HTML/TagStream/Stream.hs
@@ -2,22 +2,20 @@
module Text.HTML.TagStream.Stream where
import Data.ByteString (ByteString)
-import Data.Attoparsec.Char8 (parseOnly)
import qualified Data.ByteString.Char8 as S
+import Data.Attoparsec.ByteString (parseOnly)
import Data.Conduit
import Text.HTML.TagStream.Parser
import Text.HTML.TagStream.Types
--- | like concatMap, with a accumerator.
---
--- Since 0.0.0
+-- | html parser conduit.
tokenStream :: Resource m => Conduit ByteString m Token
tokenStream = conduitState S.empty push close
where
push accum input =
case parseOnly html (accum `S.append` input) of
+ Right (splitAccum -> (accum', tokens)) -> return $ StateProducing accum' tokens
Left err -> fail err
- Right (splitAccum -> (accum', tokens)) -> return (accum', Producing tokens)
close s = return $ if S.null s then [] else [Text s]
View
4 tagstream-conduit.cabal
@@ -1,5 +1,5 @@
Name: tagstream-conduit
-Version: 0.2.1
+Version: 0.2.2
Synopsis: streamlined html tag parser
Description:
Tag-stream is a library for parsing HTML//XML to a token stream.
@@ -32,7 +32,7 @@ Library
, Text.HTML.TagStream.Utils
Build-depends: base >= 4 && < 5
, bytestring
- , conduit >= 0.0.2
+ , conduit >= 0.2.0
, attoparsec
, blaze-builder
, blaze-builder-conduit
Please sign in to comment.
Something went wrong with that request. Please try again.