Skip to content

Instantly share code, notes, and snippets.

@balgarath
Created August 15, 2011 17:17
Show Gist options
  • Save balgarath/1147230 to your computer and use it in GitHub Desktop.
Save balgarath/1147230 to your computer and use it in GitHub Desktop.
tags = text.match(/#([a-z]|[A-Z]|[0-9]|\-|\_)+/g);
text = text.replace(new RegExp("#{tag}(?![A-Za-z0-9\-\_])", "g"), "<a class = 'tag' href = '#{@tagUrl(tag.substring(1))}'>#{tag}</a>") for tag in tags if tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment