Created
September 5, 2016 11:19
-
-
Save vishnukumarpv/9a14e1b4ff8b90c0038a55312294cfeb to your computer and use it in GitHub Desktop.
html entities removeing javascript
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 htmlEscape(s) { | |
return (s + '').replace(/&/g, '&') | |
.replace(/</g, '<') | |
.replace(/>/g, '>') | |
.replace(/'/g, ''') | |
.replace(/"/g, '"') | |
.replace(/\n/g, '<br />'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment