Skip to content

Instantly share code, notes, and snippets.

@j4johnfox
Created July 12, 2009 06:49
Show Gist options
  • Save j4johnfox/145554 to your computer and use it in GitHub Desktop.
Save j4johnfox/145554 to your computer and use it in GitHub Desktop.
@import <Foundation/CPString.j>
@implementation CPString (MMSCategories)
- (CPString)stringByEsapingHTMLEncoding
// Bruteforce way, stolen from Prototype for unescaping
// HTML encoded strings (e.g. convert &quote; to ")
{
var temp = document.createElement("div");
temp.innerHTML = self;
var result = temp.childNodes[0].nodeValue;
temp.removeChild(temp.firstChild);
return result;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment