Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Email address format XHTML compatible

cdavidcdavid New
edited September 2010 in Vanilla 2.0 - 2.8
When you have content which is served as applcation/xhtml+xml, the regular expression in js/global.js at line 160:
var email = $(this).html().replace(/<em>dot<\/em>/ig, '.').replace(/<strong>at<\/strong>/ig, '@');
will not match any more because of the XML namespace occurence.

Patch:
@@ -157,7 +157,7 @@ // Format email addresses $('span.Email').livequery(function() { var html = $(this).html(); - var email = $(this).html().replace(/<em>dot<\/em>/ig, '.').replace(/<strong>at<\/strong>/ig, '@'); + var email = $(this).html().replace(/<em[^>]+>dot<\/em>/ig, '.').replace(/<strong[^>]+>at<\/strong>/ig, '@'); $(this).html('<a href="mailto:' + email + '">' + email + '</a>'); });

Catalin
Tagged:

Comments

  • Typo:
    @@ -157,7 +157,7 @@ // Format email addresses $('span.Email').livequery(function() { var html = $(this).html(); - var email = $(this).html().replace(/<em>dot<\/em>/ig, '.').replace(/<strong>at<\/strong>/ig, '@'); + var email = $(this).html().replace(/<em[^>]*>dot<\/em>/ig, '.').replace(/<strong[^>]*>at<\/strong>/ig, '@'); $(this).html('<a href="mailto:' + email + '">' + email + '</a>'); });
Sign In or Register to comment.