doc: fix invalid path doc comments
Backport of #5670 for v4.x
The format of certain code comments in the path
documentation results
in the code blocks being invalid. I also find it confusing at least as
formatted on the website. This change is intended to improve those
comments.