Open shakesoda opened 10 years ago
It would be very easy to implement this using only javascript, like:
var regex = new RegExp('/' + window.location.host + '/');
$('.usercontent a').each(function () {
if (!regex.test(this.href)) {
this.target = '_blank';
$(this).addClass('external');
}
});
(I just mocked this up now, so no guarantees) Doing this server side might be more appropriate, but if this javascript suffices I could test and push it today.
I feel like a server-side solution is more appropriate for this. Adding target="_blank" to all links in SMBBCodeParser is trivial, but really just external ones should have it (granted, the vast majority of links will be).
Currently external links on the forum just open in the same tab, and it's annoying.