improved detection of links when linking @gemhome, update #2267