Commit Graph

10 Commits

Author SHA1 Message Date
8315b15985 Fix bad serialization, start on allowed_css_protocols 2020-05-12 23:27:41 -04:00
519c4067b7 Save parsed CSS to the arena_dom tree
Now, user transformer functions have access to the parsed CSS rules and
declarations directly on the `NodeData`. Serialization of CSS back to a string
is deferred to when the rest of the HTML tree is serialized to a string.
2020-05-09 22:23:12 -04:00
00593d3c58 Whitespace for unwrapped content & fix unwrap bug 2020-04-25 21:21:36 -04:00
fce50554a3 Clean up css_parser and main example 2020-04-25 20:37:07 -04:00
5f57b390e2 Remove debug printing, add allow_doctype config 2020-04-25 19:20:23 -04:00
caca121bef CSS sanitization and serialisation in a good place 2020-04-25 18:59:18 -04:00
e4316f1a6f Still trying to figure out css serialization 2020-04-24 00:36:04 -04:00
5b0c724bac Add more sanitizing transforms with tests 2020-04-22 21:25:11 -04:00
87c1832896 Better impl Display for Node, fix test 2020-04-22 14:32:15 -04:00
c9c89f3622 Replace Transformer with Sanitizer
Tried to keep them separate but it was starting to get too messy. Users can just
pass in custom transformers in the second constructor argument. Plus, this more
closely matches the ruby sanitize API.

Changed config to be a struct. So far, have only made a `DEFAULT_CONFIG`. Need
to make all of the others as well.

Started working on a `remove_contents_when_unwrapped` option to the config that
will indicate whether to remove contents of elements that are unwrapped.
2020-04-21 21:35:08 -04:00