by Ange Tuteur June 14th 2017, 7:18 pm
Hi
@SLGray,
Go to Admin Panel > Modules > JS Codes management > New
Placement : In all the pages ..? (I'm not sure if "in the topics" is applicable here)
- Code:
$(function() {
// parses hyperlinks in classified ad descriptions
for (var a = $('.AD_Description'), i = 0, j = a.length; i < j; i++) {
a[i].innerHTML = a[i].innerHTML.replace(/(http(?:s|):\/\/.*?)(\s| |<br>|$)/ig, function (match, $1, $2) {
return '<a class="AD_Description_Link" href="' + $1 + '" target="' + ( new RegExp(window.location.host).test($1) ? '_self' : '_blank' ) + '">' + $1 + '</a>' + $2;
});
}
'par ange tuteur';
});
It should automatically parse text which begins with http or https as links. If any issues, let me know.