// Simplified implementation
String(str).replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
Created
January 26, 2023 21:02
-
-
Save vyspiansky/cf64ce05bd2ead859aa82a14f9f33651 to your computer and use it in GitHub Desktop.
HTML entities in JavaScript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment