JSFiddle - React, Tailwind, and code Playground
by David Thomas
HTML
<p>This is a long text. It contains 150 characters. You can find more about this text on this link http://www.somewebsite.com/RDFCCSDVDS</p>
JavaScript
var $words = $('p').text().split(' ');
for (i in $words) {
if ($words[i].indexOf('http://') == 0) {
$words[i] = '<a href="' + $words[i] + '">' + $words[i] + '</a>';
}
}
$('p').html($words.join(' '));