bloody-escapehtml

1.1.0 • Public • Published

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;"

Readme

Keywords

none

Package Sidebar

Install

npm i bloody-escapehtml

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bloodyowl