In my db I have saved every links in the form:
www.example.com or http://www.example.com
Is there a way to turn this text links into HTML links at the client side ( e.g. javascript ) with tag and parameter like this ?:
<a href="http://www.example.com" rel="nofollow">www.example.com</a>
This would probably be smarter to do on the server side like cherouvim suggested, but here’s a (naive) javascript function that does this for the specified formats (url with and without http://-prefix)
Please note it doesn’t handle unexpected input (https…) very well, so please don’t use as-is in production environment 🙂