Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: drop
alter*
props in favor of domVisitors
The new prop is an object with 3 optional callbacks, `onElement`, `onDocument` and `onText` which you can use to intercept and tamper nodes during parsing. Take advantage of [domutils](https://github.com/fb55/domutils) library to delete, insert and manipulate those nodes. The new TRE engine uses a custom parser to support these callbacks. Therefore, a supplementary tree traversal after parsing is not required anymore, removing a O(n) computational cost. BREAKING CHANGE: `alterDOMNode`, `alterDOMData` and `alterDOMChildren` have been dropped in favor of `domVisitors`. The latter is an object with 3 optional callbacks, `onElement`, `onDocument` and `onText` which you can use to intercept and tamper nodes during parsing. Take advantage of [domutils](https://github.com/fb55/domutils) library to delete, insert and manipulate those nodes.
- Loading branch information