Skip to content

Instantly share code, notes, and snippets.

@joshholt
Created October 30, 2009 00:25
Show Gist options
  • Save joshholt/221980 to your computer and use it in GitHub Desktop.
Save joshholt/221980 to your computer and use it in GitHub Desktop.
/*globals Twitapp*/
Twitapp.String = {
stripTags: function() {
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
},
unescapeHTML: function () {
return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&').replace(/&quot;/g,'\"');
}
};
// Apply Twitapp.String mixin to built-in String object
SC.supplement(String.prototype, Twitapp.String);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment