Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Contains functions to escape text for inclusion in HTML.
- data Escaper
- escapeAttributeCharacter :: Char -> String
- escapeContentCharacter :: Char -> String
- escapeAttributeValue :: Text -> Text
- escapeContent :: Text -> Text
- escapeCharacter :: Escaper -> Char -> String
Documentation
Represents a type of escaping to be applied to text.
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 >
.