Correctly detect hyperlinks with leading and trailing spaces