@aeva sxpp would be the equivalent tool. you define rewrite rules which transform the document.
all tests in https://git.sr.ht/~duangle/sxpp/tree/master/item/testing are evaluated using https://git.sr.ht/~duangle/sxpp/tree/master/item/testing/testing-rules.sx
the builtin form reference is here https://git.sr.ht/~duangle/sxpp/tree/master/item/doc/reference.md and is tested here https://git.sr.ht/~duangle/sxpp/tree/master/item/testing/builtins.sx
it's intended as a preprocessor but can also be used standalone.
