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

-- | sanitize untrusted HTML to prevent XSS attacks
--   
--   run untrusted HTML through Text.HTML.SanitizeXSS.sanitizeXSS to
--   prevent XSS attacks. see README.md
--   http://github.com/yesodweb/haskell-xss-sanitize for more
--   details
@package xss-sanitize
@version 0.3.7.2

-- | Sanatize HTML to prevent XSS attacks.
--   
--   See README.md http://github.com/gregwebs/haskell-xss-sanitize
--   for more details.
module Text.HTML.SanitizeXSS

-- | Sanitize HTML to prevent XSS attacks. This is equivalent to
--   filterTags safeTags.
sanitize :: Text -> Text

-- | Sanitize HTML to prevent XSS attacks and also make sure the tags are
--   balanced. This is equivalent to filterTags (balanceTags .
--   safeTags).
sanitizeBalance :: Text -> Text

-- | alias of sanitize function
sanitizeXSS :: Text -> Text

-- | Parse the given text to a list of tags, apply the given filtering
--   function, and render back to HTML. You can insert your own custom
--   filtering, but make sure you compose your filtering function with
--   safeTags and clearTags or safeTagsCustom and
--   clearTagsCustom.
filterTags :: ([Tag Text] -> [Tag Text]) -> Text -> Text

-- | Filters out unsafe tags and sanitizes attributes. Use with filterTags
--   to create a custom filter.
safeTags :: [Tag Text] -> [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.
safeTagsCustom :: (Text -> Bool) -> ((Text, Text) -> Maybe (Text, Text)) -> [Tag Text] -> [Tag Text]

-- | Directly removes tags even if they are not closed properly. This is
--   importent to clear out both the script and iframe tag in sequences
--   like "scriptiframe/iframe".
clearTags :: [Tag Text] -> [Tag Text]

-- | Directly removes tags, like clearTags, but uses a custom function for
--   determining which tags are safe.
--   
--   clearTagsCustom clearableTagName is equivalent to
--   clearTags.
clearTagsCustom :: (Text -> Bool) -> [Tag Text] -> [Tag Text]

-- | Filter which makes sure the tags are balanced. Use with
--   filterTags and safeTags to create a custom filter.
balanceTags :: [Tag Text] -> [Tag Text]
safeTagName :: Text -> Bool

-- | low-level API if you have your own HTML parser. Used by safeTags.
sanitizeAttribute :: (Text, Text) -> Maybe (Text, Text)

-- | Returns True if the specified URI is not a potential security
--   risk.
sanitaryURI :: Text -> Bool
