make sure URL is valid before auto linking, fixes #40