diff --git a/spamspan.compressed.js b/spamspan.compressed.js
index ff01571..0793915 100644
--- a/spamspan.compressed.js
+++ b/spamspan.compressed.js
@@ -1 +1 @@
-Drupal.behaviors.spamspan=function(_1){$("span."+Drupal.settings.spamspan.m,_1).each(function(_2){var _3=($("span."+Drupal.settings.spamspan.u,this).text()+"@"+$("span."+Drupal.settings.spamspan.d,this).text()).replace(/\s+/g,"").replace(/\[dot\]/g,".");var _4=$("span."+Drupal.settings.spamspan.h,this).text().replace(/^ ?\((.*)\) ?$/,"$1");var _5=$.map(_4.split(/, /),function(n,i){return (n.replace(/: /,"="));});var _6=$("span."+Drupal.settings.spamspan.t,this).text().replace(/^ \((.*)\)$/,"$1");var _7="mailto:"+encodeURIComponent(_3);var _8=_5.join("&");_7+=_8?("?"+_8):"";$(this).after($("<a></a>").attr("href",_7).html(_6?_6:_3).addClass("spamspan")).remove();});};
\ No newline at end of file
+Drupal.behaviors.spamspan=function(a){$("span."+Drupal.settings.spamspan.m,a).each(function(e){var b=($("span."+Drupal.settings.spamspan.u,this).text()+"@"+$("span."+Drupal.settings.spamspan.d,this).text()).replace(/\s+/g,"").replace(/\[dot\]/g,".");var d=$("span."+Drupal.settings.spamspan.h,this).text().replace(/^ ?\((.*)\) ?$/,"$1");var g=$.map(d.split(/, /),function(k,j){return(k.replace(/: /,"="))});if($("span."+Drupal.settings.spamspan.t,this).find("img").length>0){var c=$("span."+Drupal.settings.spamspan.t,this).html().replace(/^ ?\((.*)\)$/,"$1")}else{var c=$("span."+Drupal.settings.spamspan.t,this).text().replace(/^ ?\((.*)\)$/,"$1")}var f="mailto:"+encodeURIComponent(b);var h=g.join("&");f+=h?("?"+h):"";$(this).after($("<a></a>").attr("href",f).html(c?c:b).addClass("spamspan")).remove()})};
\ No newline at end of file
diff --git a/spamspan.js b/spamspan.js
index 1b79c47..6c95087 100644
--- a/spamspan.js
+++ b/spamspan.js
@@ -31,7 +31,14 @@ Drupal.behaviors.spamspan = function(context) {
             return (n.replace(/: /,"="));
           });
 // Find the anchor text, and remove the round brackets from the start and end
-	    var _anchorText = $("span." +  Drupal.settings.spamspan.t, this).text().replace(/^ \((.*)\)$/, "$1");
+
+      if ($("span." +  Drupal.settings.spamspan.t, this).find("img").length > 0) {
+        var _anchorText = $("span." +  Drupal.settings.spamspan.t, this).html().replace(/^ ?\((.*)\)$/, "$1");
+      }
+      else {
+        var _anchorText = $("span." +  Drupal.settings.spamspan.t, this).text().replace(/^ ?\((.*)\)$/, "$1");
+      }
+      
 // Build the mailto URI
   var _mailto = "mailto:" + encodeURIComponent(_mail);
   var _headerstring = _headers.join('&');
