Created
November 8, 2016 01:05
-
-
Save devheedoo/570fea0b65a2e9c63e702626dbac690a to your computer and use it in GitHub Desktop.
Restore HTML
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
function restoreHtml(content){ | |
if(content == "" || $.trim(content) == ""){ | |
return content; | |
} | |
content = content.replace(/\</gi,"<"); | |
content = content.replace(/\>/gi,">"); | |
content = content.replace(/\&lt;/gi,"<"); | |
content = content.replace(/\&gt;/gi,">"); | |
content = content.replace(/\[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']/gi, "\"\""); | |
content = content.replace(/\script/gi, ""); | |
content = content.replace(/\(/gi,"("); | |
content = content.replace(/\)/gi,")"); | |
content = content.replace(/\'/gi, "'"); | |
return content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment