Function hardenAnchorLinks