chore(docs): add directive to pad heading anchors

Closes #2070
Closes #9360
This tes is kind of too relaxed, because using `children()` will only retrieve the element nodes (not text nodes for example). An `h` element will most probably contain text nodes, so if we want to make sure the anchor is added at the right place we need to account for those as well.

Using `.contents()` instead, seems more to the point.

--
(I am not saying the directive is not working as expected; it is. But if it weren't (or if is breaks in the future), this test might still succeed.)