flamethrower-0.0.5.1: A template engine for HTML

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Flamethrower.Escape

Description

Contains functions to escape text for inclusion in HTML.

Synopsis

Documentation

data Escaper Source

Represents a type of escaping to be applied to text.

Constructors

None

Perform no escaping.

Content

Escape for inclusion as content in HTML – that is, for use between tags. This escapes &, <, and >.

Attribute

Escape for inclusion in a double-quoted HTML attribute value. This escapes & and ".

Instances

escapeAttributeCharacter :: Char -> String Source

Converts a character into an equivalent HTML character reference if necessary for it to be correctly included in a double-quoted HTML attribute value. This escapes & and ".

escapeContentCharacter :: Char -> String Source

Converts a character into an equivalent HTML character reference if necessary for it to be correctly included as content – that is, between HTML tags. This escapes &, <, and >.

escapeAttributeValue :: Text -> Text Source

Converts characters in text into equivalent HTML character references when necessary for the entire string to be correctly included in a double-quoted HTML attribute value. This escapes & and ".

escapeContent :: Text -> Text Source

Converts characters in text into equivalent HTML character references when necessary for the entire string to be correctly included as content – that is, between HTML tags. This escapes &, <, and >.

escapeCharacter :: Escaper -> Char -> String Source

Converts a character into an equivalent HTML character reference as defined by the given Escaper.