-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A codec library for HTML-escaped text and HTML-entities
--   
--   This library provides the following APIs for coding and decoding of
--   HTML-escaped text: * "attoparsec" parser * Text decoder * Encoding
--   text builder
@package html-entities
@version 1.1.4.7


-- | Attoparsec parsers.
module HTMLEntities.Parser

-- | A parser of a single entity.
--   
--   Parses numeric encoding:
--   
--   <pre>
--   &gt;&gt;&gt; mapM_ Data.Text.IO.putStrLn $ Data.Attoparsec.Text.parseOnly htmlEntity "&amp;#169;"
--   ©
--   </pre>
--   
--   as well as the named entities:
--   
--   <pre>
--   &gt;&gt;&gt; mapM_ Data.Text.IO.putStrLn $ Data.Attoparsec.Text.parseOnly htmlEntity "&amp;copy;"
--   ©
--   </pre>
htmlEntity :: Parser Text

-- | A parser of the body of a single entity.
--   
--   Parses numeric encoding:
--   
--   <pre>
--   &gt;&gt;&gt; mapM_ Data.Text.IO.putStrLn $ Data.Attoparsec.Text.parseOnly htmlEntityBody "#169"
--   ©
--   </pre>
--   
--   as well as the named entities:
--   
--   <pre>
--   &gt;&gt;&gt; mapM_ Data.Text.IO.putStrLn $ Data.Attoparsec.Text.parseOnly htmlEntityBody "copy"
--   ©
--   </pre>
htmlEntityBody :: Parser Text


-- | Utilities, which execute the parser.
module HTMLEntities.Decoder

-- | A decoder of a single entity.
--   
--   <pre>
--   &gt;&gt;&gt; mapM_ Data.Text.IO.putStrLn $ htmlEntity "&amp;#169;"
--   ©
--   </pre>
htmlEntity :: Text -> Either String Text

-- | A decoder of a single entity.
--   
--   <pre>
--   &gt;&gt;&gt; mapM_ Data.Text.IO.putStrLn $ htmlEntityBody "#169"
--   ©
--   </pre>
htmlEntityBody :: Text -> Either String Text

-- | 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 <a>"text"</a> or <a>"conversion-text"</a>
--   library.
--   
--   <pre>
--   &gt;&gt;&gt; Data.Text.Lazy.IO.putStrLn $ Data.Text.Lazy.Builder.toLazyText $ htmlEncodedText "&amp;euro;5 &amp;cent;2"
--   €5 ¢2
--   </pre>
htmlEncodedText :: Text -> Builder

module HTMLEntities.Builder

-- | HTML-encodes the given char into a text builder.
char :: Char -> Builder

-- | HTML-encodes the given text into a text builder.
--   
--   <pre>
--   &gt;&gt;&gt; Data.Text.Lazy.IO.putStrLn $ Data.Text.Lazy.Builder.toLazyText $ text "&lt;a href=\"\"&gt;"
--   &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;
--   </pre>
text :: Text -> Builder

module HTMLEntities.Text

-- | HTML-encodes the given char.
char :: Char -> Text

-- | HTML-encodes the given text.
--   
--   <pre>
--   &gt;&gt;&gt; Data.Text.IO.putStrLn $ text "&lt;a href=\"\"&gt;"
--   &amp;lt;a href=&amp;quot;&amp;quot;&amp;gt;
--   </pre>
text :: Text -> Text
