Created
October 30, 2009 00:25
-
-
Save joshholt/221980 to your computer and use it in GitHub Desktop.
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
/*globals Twitapp*/ | |
Twitapp.String = { | |
stripTags: function() { | |
return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); | |
}, | |
unescapeHTML: function () { | |
return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&').replace(/"/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