Skip to content

A faster Elixir HTML sanitization library with similar behavior to HTMLSanitizeEx. THIS IS A MIRROR, real repo at https://git.pleroma.social/pleroma/elixir-libraries/fast_sanitize

License

Notifications You must be signed in to change notification settings

rinpatch/fast_sanitize

Repository files navigation

FastSanitize

A high performance HTML sanitization library built on FastHTML, our rewrite of Myhtmlex. It was created to improve HTML sanitization performance in Pleroma, a high-performance, versatile federated social networking platform.

Features

  • Meta-programming: build your own scrubbing policies with macros, mostly compatible with HtmlSanitizeEx.
  • Performance: on average, 2-3 times faster than HtmlSanitizeEx with typical documents with considerably less memory usage.
  • Uses the MyHTML parsing engine which parses HTML in the same way browsers do.
  • Uses an efficient AST for scrubbing HTML nodes and Erlang iolists for efficient HTML generation.

Installation

The package can be installed by adding fast_sanitize to your list of dependencies in mix.exs:

def deps do
  [
    {:fast_sanitize, "~> 0.1.0"}
  ]
end

Docs can be found at https://hexdocs.pm/fast_sanitize.

About

A faster Elixir HTML sanitization library with similar behavior to HTMLSanitizeEx. THIS IS A MIRROR, real repo at https://git.pleroma.social/pleroma/elixir-libraries/fast_sanitize

Resources

License

Stars

Watchers

Forks

Packages

No packages published