1.1.0 • Published 10 years ago

bloody-escapehtml v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

escapeHTML

browser support

Build Status

install

$ npm install bloody-escapehtml

require

var escapeHTML = require("bloody-escapehtml")

api

escapeHTML(string) > escapedString

escapes special HTML chars :

& => &
< => &lt;
> => &gt;
" => &quot;
' => &#39;

escapeHTML.unescapeHTML(string) > string

unescapes special HTML chars.

example

var safeValue = escapeHTML(input.value)
// -> "&lt;div&gt;&lt;/div&gt;"
1.1.0

10 years ago

1.0.0

10 years ago