packages feed

html-entities 1.0.0.2 → 1.0.0.3

raw patch · 3 files changed

+16/−10 lines, 3 files

Files

html-entities.cabal view
@@ -1,7 +1,7 @@ name:   html-entities version:-  1.0.0.2+  1.0.0.3 synopsis:   An "attoparsec" parser and a decoder of HTML entities category:
library/HTMLEntities/Decoder.hs view
@@ -14,8 +14,8 @@ -- | -- A decoder of a single entity. -- --- >>> htmlEntity "&#169;"--- Right "\169"+-- >>> mapM_ Data.Text.IO.putStrLn $ htmlEntity "&#169;"+-- © htmlEntity :: Decoder Text htmlEntity =   P.parseOnly $@@ -26,10 +26,11 @@ --  -- Produces a text builder,  -- which you can then convert into a text or a lazy text,--- using the \"text\" library.+-- using the <http://hackage.haskell.org/package/text "text"> or +-- <http://hackage.haskell.org/package/conversion-text "conversion-text"> library. -- --- >>> fmap TLB.toLazyText $ htmlEncodedText "&euro;5 &cent;2"--- Right "\8364\&5 \162\&2"+-- >>> mapM_ (Data.Text.Lazy.IO.putStrLn . Data.Text.Lazy.Builder.toLazyText) $ htmlEncodedText "&euro;5 &cent;2"+-- €5 ¢2 htmlEncodedText :: Decoder TLB.Builder htmlEncodedText =   P.parseOnly $
library/HTMLEntities/Parser.hs view
@@ -11,11 +11,16 @@ -- | -- A parser of a single entity. -- --- >>> parseOnly htmlEntity "&copy;"--- Right "\169"+-- Parses numeric encoding: -- --- >>> parseOnly htmlEntity "&#169;"--- Right "\169"+-- >>> mapM_ Data.Text.IO.putStrLn $ Data.Attoparsec.Text.parseOnly htmlEntity "&#169;"+-- ©+-- +-- as well as named entities:+-- +-- >>> mapM_ Data.Text.IO.putStrLn $ Data.Attoparsec.Text.parseOnly htmlEntity "&copy;"+-- ©+--  {-# INLINABLE htmlEntity #-} htmlEntity :: Parser Text htmlEntity =