JavaScript port of Django's function for converting URLs in text into clickable links.