mirror of
https://github.com/alpmestan/taggy.git
synced 2024-09-11 15:05:40 +03:00
add haddocks in Parser module
This commit is contained in:
parent
431c889ba9
commit
297c7d477c
@ -193,12 +193,19 @@ tag' b =
|
||||
<|> tagclose
|
||||
<|> tagtext b
|
||||
|
||||
-- | Do we want to convert html entities to their unicode chars
|
||||
-- | Get a list of tags from an HTML document
|
||||
-- represented as a 'LT.Text' value.
|
||||
--
|
||||
-- The 'Bool' lets you specify whether you want
|
||||
-- to convert HTML entities to their corresponding
|
||||
-- unicode character. ('True' means "yes convert")
|
||||
taggyWith :: Bool -> LT.Text -> [Tag]
|
||||
taggyWith cventities =
|
||||
either (const []) id
|
||||
. AttoLT.eitherResult
|
||||
. AttoLT.parse (htmlWith cventities)
|
||||
|
||||
-- | Same as 'taggyWith' but hands you back a
|
||||
-- 'AttoLT.Result' from @attoparsec@
|
||||
run :: Bool -> LT.Text -> AttoLT.Result [Tag]
|
||||
run cventities = AttoLT.parse (htmlWith cventities)
|
||||
|
Loading…
Reference in New Issue
Block a user