This repository has been archived by the owner on Feb 28, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(transformer): enable recursive processing in custom handler func…
…tions The VDOMTransformer's `handler` functions did not allow for recursive processing of child nodes so far, i.e. when a handler function wanted to process only a single MDAST node, but hand the processing of all MDAST child nodes back to the original transformer, it had no way of doing so, making each `handler` function a terminal node. With this change, the signature of `handler` functions changes to `handler(callback, node, parent, handlechild)` where `handlechild(callback, childnode, mdastparent, hastparent)` is a callback itself that takes the current HTAST-constructing `callback`, the MDAST `childnode` that should get transformed, the `mdastparent`, i.e. the current node from the vantage point of the `handler` function, and with `hastparent` a HAST parent node that the output of the child processing will be attached to.
- Loading branch information