rustdoc: use the same URL escape rules for fragments as for examples Carries over improvements from #107284