https://github.com/rinpatch/fast_sanitize
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
https://github.com/rinpatch/fast_sanitize
Last synced: 5 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/rinpatch/fast_sanitize
- Owner: rinpatch
- License: mit
- Created: 2020-03-23T22:02:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-31T06:53:50.000Z (almost 6 years ago)
- Last Synced: 2025-06-26T22:51:34.385Z (12 months ago)
- Language: HTML
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# FastSanitize
A high performance HTML sanitization library built on [FastHTML][fh], our
rewrite of Myhtmlex. It was created to improve HTML sanitization performance
in [Pleroma][pl], a high-performance, versatile federated social networking
platform.
[fh]: https://git.pleroma.social/pleroma/myhtmlex
[pl]: https://pleroma.social
## 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`:
```elixir
def deps do
[
{:fast_sanitize, "~> 0.1.0"}
]
end
```
Docs can be found at [https://hexdocs.pm/fast_sanitize](https://hexdocs.pm/fast_sanitize).