Commit Graph

26 Commits

Author SHA1 Message Date
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
269f296d48 Add TODO section to README 2020-04-26 02:12:21 -04:00
9a5219f104 Add paragraph about typed-arena to README 2020-04-26 01:52:48 -04:00
db8590d029 Center README image 2020-04-26 01:25:02 -04:00
aa582ee33d Add basic README 2020-04-26 01:17:06 -04:00
6bdb5f97ea Clean up sanitizer configs 2020-04-25 22:11:59 -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
446aff77af Parse HTML fragments 2020-04-19 15:41:16 -04:00
28caafb41c Rename Traverser -> Transformer 2020-04-18 18:34:53 -04:00
34ffccc512 Clean up lint errors, add tests 2020-04-18 18:30:15 -04:00
f1671c0758 Split up transform_node into separate functions 2020-04-16 19:44:59 -04:00
47bd10f508 Abstracted out all traversal logic to Traverser 2020-04-16 18:29:59 -04:00
e20ec1224e Trying to abstract out traversal, test hanging 2020-04-16 00:37:01 -04:00
359be3a3e3 Filtering at-rules by name 2020-03-21 23:12:01 -04:00
de742425d0 Beginnings of at-rule parsing 2020-03-19 18:40:28 -04:00
6a4c68a833 Working CSS property sanitizer 2020-03-19 17:03:27 -04:00
Tyler Hallada
0d07cd8ed8 WIP adding css property names to string cache 2020-03-19 14:34:24 -04:00
f6f8088b64 Add rudimentary css parser
Doesn't actually parse declaration values yet.
2020-03-05 00:17:29 -05:00
Tyler Hallada
6f682f1e91 Initial commit: arena_dom and basic sanitize 2019-03-09 20:26:43 -05:00