Created
May 29, 2013 20:41
-
-
Save crswll/5673671 to your computer and use it in GitHub Desktop.
A person in IRC wanted some help with getting some #hashtags "highlighted" in a div.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.bio').html(function(i,html){ | |
return html.split(' ').map(function(word){ | |
if( word.substr(0,1) === '#' ){ | |
return '<strong>' + word + '</strong>'; | |
} else { | |
return word; | |
} | |
}).join(' '); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment