From 297c7d477cc4ec72f066b14dcf772975ef5c13f6 Mon Sep 17 00:00:00 2001 From: Alp Mestanogullari Date: Tue, 1 Jul 2014 14:22:43 +0200 Subject: [PATCH] add haddocks in Parser module --- src/Text/Taggy/Parser.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Text/Taggy/Parser.hs b/src/Text/Taggy/Parser.hs index 39cbe98..e7dc2cc 100644 --- a/src/Text/Taggy/Parser.hs +++ b/src/Text/Taggy/Parser.hs @@ -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)