Con jQuery possiamo individuare e sostituire con link gli indirizzi e-mail presenti nel testo.
La soluzione è la seguente:
$(function() {
$( "p" ).each(function() {
var html = $( this ).html();
var regex = /([a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,4})/ig
var text = html.replace( regex, "<a href='mailto:$1'>$1</a>" );
$( this ).html( text );
});
});