More robust handling of documentation anchors vs links