I have text:
I love Stackoverflow so much, so please visist http://stackoverflow.com
How can I transform it to:
I love Stackoverflow so much, so please visist <a href='http://stackoverflow.com'>http://stackoverflow.com</a>
in the easiest way in javascript?
Note that the url in text could be without http://
and without wwww
, but I want the attribute href
to contain at least http://
. Also take in consideration that some links are https://