Adding the nofollow attribute to external links with jQuery
Today over at House of Fusion Jeff Becker asked:
I'm looking for a working rel="nofollow" regex to modify links. For example:
Goto <a href="http://google.com">Google</a> now!
turning it into:
Goto <a href="http://google.com" rel="nofollow">Google</a> now!
<a href="/somepage.html">This is an internal link</a>
<br /><br />
<a href="http://google.com">And this is an external link, with no follow</a>
Secondly the 45 characters of jQuery needed to convert all external facing URLs and add the nofollow parameter
All hail jQuery.