Escape string for use in html
Escape a string to be safe for use in html.
characters are replaced with with their named character references:
". Escaped strings will be safe
for use in the following contexts:
var escape = require"html-escape";var xssAttempt = "Hello <script>while(1);</script> world!";// Output safe htmlconsole.log"<p>" + escapexssAttempt + "</p>";// "<p>Hello <script>while(1);</script> world!</p>"
npm install html-escape