Add port number detection to automatic links