Add basic README
This commit is contained in:
parent
6bdb5f97ea
commit
aa582ee33d
30
README.md
Normal file
30
README.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# chela: HTML & CSS Sanitizer and Transformer
|
||||||
|
|
||||||
|
![chela](img/chela.svg)
|
||||||
|
|
||||||
|
chela (/ˈkiːlə/ — KEE-LUH) is a program that prunes untrusted HTML and CSS using
|
||||||
|
a whitelist of rules. It is also a library for general-purpose HTML and CSS
|
||||||
|
transforming that allows users to define custom functions that modify the parsed
|
||||||
|
HTML tree node-by-node as it is traversed.
|
||||||
|
|
||||||
|
**This is still an experimental project. Use in production environments at your
|
||||||
|
own risk.**
|
||||||
|
|
||||||
|
chela is heavily inspired by the Ruby project
|
||||||
|
[sanitize](https://github.com/rgrove/sanitize). The goal of chela is to match
|
||||||
|
the ease and usability of sanitize but with the performance and reliability of
|
||||||
|
Rust under the hood. The browser-grade
|
||||||
|
[html5ever](https://github.com/servo/html5ever) HTML parser and
|
||||||
|
[rust-cssparser](https://github.com/servo/rust-cssparser) are used to parse HTML
|
||||||
|
and CSS respectively.
|
||||||
|
|
||||||
|
## Why chela?
|
||||||
|
|
||||||
|
At the time of writing, [ammonia](https://github.com/rust-ammonia/ammonia) is
|
||||||
|
the most popular and battle-tested HTML sanitization library written in Rust. In
|
||||||
|
most cases, it should be used over this library. However, chela provides
|
||||||
|
sanitization of CSS in addition to HTML, which ammonia does not support. Also,
|
||||||
|
chela allows users to write custom functions to perform more complex
|
||||||
|
transformations that simple whitelist rules cannot support. In this way, chela
|
||||||
|
is more than a sanitization library, but a tool to rapidly perform
|
||||||
|
transformations on HTML and CSS inputs.
|
1
img/chela.svg
Normal file
1
img/chela.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" viewBox="0 0 100 100"><g transform="translate(50 50) scale(0.69 0.69) rotate(-15) translate(-50 -50)" style="fill:#d14e21"><svg fill="#d14e21" xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 64 64" x="0px" y="0px"><title>crab-claw-shell-animal-aquatic-cuisine</title><path d="M34.972,29.382l3.589,2.87,5.594-12.9a9.554,9.554,0,0,0-1.228-9.638l-8.9,18.911Z"></path><polygon points="42.986 54 41.5 54 37 60 42.907 60 42.986 54"></polygon><polygon points="39.776 52.964 35.952 47.191 27.225 47.191 35.059 59.255 39.776 52.964"></polygon><path d="M25.821,45.191h10.04a22.492,22.492,0,0,0,2.1-9.455v-1.4l-5.8-4.636a.962.962,0,0,1-.2-.224.716.716,0,0,1-.046-.08.957.957,0,0,1-.082-.2c-.008-.029-.018-.057-.024-.086a1,1,0,0,1-.019-.29v-.009l2.358-24.77A14.756,14.756,0,0,0,24.037,9.159L22.776,10.63A24,24,0,0,0,23.342,42.5ZM28.739,7.785,29.761,9.5a10.761,10.761,0,0,0-2.686,2.259l-1.519-1.3A12.75,12.75,0,0,1,28.739,7.785ZM24.3,11.932l1.517,1.3a20.068,20.068,0,0,0-2.774,4.217l-1.8-.881A21.991,21.991,0,0,1,24.3,11.932ZM19,23h2v2H19Zm0,4h2v2H19Zm4,6H21V31h2Zm0-8h2v2H23Z"></path></svg></g></svg>
|
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in New Issue
Block a user