html-entities-1.0.0.3: An "attoparsec" parser and a decoder of HTML entities

Safe HaskellNone
LanguageHaskell2010

HTMLEntities.Decoder

Description

Utilities, which execute the parser.

Synopsis

Documentation

htmlEntity :: Decoder Text Source

A decoder of a single entity.

>>> mapM_ Data.Text.IO.putStrLn $ htmlEntity "©"
©

htmlEncodedText :: Decoder Builder Source

A decoder of a text with entities.

Produces a text builder, which you can then convert into a text or a lazy text, using the "text" or "conversion-text" library.

>>> mapM_ (Data.Text.Lazy.IO.putStrLn . Data.Text.Lazy.Builder.toLazyText) $ htmlEncodedText "€5 ¢2"
€5 ¢2