HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulexss-sanitize-0.3.7.2Haskell2010

Text.HTML.SanitizeXSS

Sanatize HTML to prevent XSS attacks.

See README.md http://github.com/gregwebs/haskell-xss-sanitize for more details.

  • 12 values

Sanitize

3 declarations
valuesanitize :: Text -> Text
#

Sanitize HTML to prevent XSS attacks. This is equivalent to filterTags safeTags.

valuesanitizeBalance :: Text -> Text
#

Sanitize HTML to prevent XSS attacks and also make sure the tags are balanced. This is equivalent to filterTags (balanceTags . safeTags).

Custom filtering

6 declarations
valuesafeTags :: [Tag Text] -> [Tag Text]
#

Filters out unsafe tags and sanitizes attributes. Use with filterTags to create a custom filter.

valuesafeTagsCustom
  1. :: (Text -> Bool)

    Select safe tags, like safeTagName

  2. -> ((Text, Text) -> Maybe (Text, Text))

    Sanitize attributes, like sanitizeAttribute

  3. -> [Tag Text]
  4. -> [Tag Text]
#

Filters out unsafe tags and sanitizes attributes, like safeTags, but uses custom functions for determining which tags are safe and for sanitizing attributes. This allows you to add or remove specific tags or attributes on the white list, or to use your own white list.

safeTagsCustom safeTagName sanitizeAttribute is equivalent to safeTags.

Utilities

3 declarations
valuesanitaryURI :: Text -> Bool
#

Returns True if the specified URI is not a potential security risk.