Socket
Socket
Sign inDemoInstall

he

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.1 to 0.5.0

2

LICENSE-MIT.txt

@@ -1,2 +0,2 @@

Copyright Mathias Bynens <http://mathiasbynens.be/>
Copyright Mathias Bynens <https://mathiasbynens.be/>

@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining

{
"name": "he",
"version": "0.4.1",
"version": "0.5.0",
"description": "A robust HTML entities encoder/decoder with full Unicode support.",

@@ -17,11 +17,6 @@ "homepage": "http://mths.be/he",

],
"licenses": [
{
"type": "MIT",
"url": "http://mths.be/mit"
}
],
"license": "MIT",
"author": {
"name": "Mathias Bynens",
"url": "http://mathiasbynens.be/"
"url": "https://mathiasbynens.be/"
},

@@ -32,5 +27,3 @@ "repository": {

},
"bugs": {
"url": "https://github.com/mathiasbynens/he/issues"
},
"bugs": "https://github.com/mathiasbynens/he/issues",
"files": [

@@ -51,15 +44,15 @@ "LICENSE-MIT.txt",

"devDependencies": {
"grunt": "~0.4.5",
"grunt-shell": "~0.7.0",
"grunt-template": "~0.2.3",
"istanbul": "~0.2.10",
"jsesc": "~0.4.3",
"lodash": "~2.4.1",
"lodash.difference": "~2.4.1",
"qunit-extras": "~1.1.0",
"coveralls": "^2.11.1",
"grunt": "^0.4.5",
"grunt-shell": "^1.0.1",
"grunt-template": "^0.2.3",
"istanbul": "^0.3.0",
"jsesc": "^0.5.0",
"lodash": "^2.4.1",
"qunit-extras": "^1.1.0",
"qunitjs": "~1.11.0",
"regenerate": "~0.6.2",
"requirejs": "~2.1.11",
"string.fromcodepoint": "~0.2.0"
"regenerate": "^0.6.2",
"requirejs": "^2.1.14",
"string.fromcodepoint": "^0.2.1"
}
}

@@ -1,4 +0,4 @@

# he [![Build status](https://travis-ci.org/mathiasbynens/he.svg?branch=master)](https://travis-ci.org/mathiasbynens/he) [![Dependency status](https://gemnasium.com/mathiasbynens/he.svg)](https://gemnasium.com/mathiasbynens/he)
# he [![Build status](https://travis-ci.org/mathiasbynens/he.svg?branch=master)](https://travis-ci.org/mathiasbynens/he) [![Code coverage status](http://img.shields.io/coveralls/mathiasbynens/he/master.svg)](https://coveralls.io/r/mathiasbynens/he) [![Dependency status](https://gemnasium.com/mathiasbynens/he.svg)](https://gemnasium.com/mathiasbynens/he)
_he_ (for “HTML entities”) is a robust HTML entity encoder/decoder written in JavaScript. It supports [all standardized named character references as per HTML](http://www.whatwg.org/specs/web-apps/current-work/multipage/named-character-references.html), handles [ambiguous ampersands](http://mathiasbynens.be/notes/ambiguous-ampersands) and other edge cases [just like a browser would](http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references), has an extensive test suite, and — contrary to many other JavaScript solutions — _he_ handles astral Unicode symbols just fine. [An online demo is available.](http://mothereff.in/html-entities)
_he_ (for “HTML entities”) is a robust HTML entity encoder/decoder written in JavaScript. It supports [all standardized named character references as per HTML](http://www.whatwg.org/specs/web-apps/current-work/multipage/named-character-references.html), handles [ambiguous ampersands](https://mathiasbynens.be/notes/ambiguous-ampersands) and other edge cases [just like a browser would](http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references), has an extensive test suite, and — contrary to many other JavaScript solutions — _he_ handles astral Unicode symbols just fine. [An online demo is available.](http://mothereff.in/html-entities)

@@ -109,3 +109,3 @@ ## Installation

The default value for the `encodeEverything` option is `false`. This means that `encode()` will not use any character references for printable ASCII symbols that don’t need escaping. Set it to `true` to encode every symbol in the input string.
The default value for the `encodeEverything` option is `false`. This means that `encode()` will not use any character references for printable ASCII symbols that don’t need escaping. Set it to `true` to encode every symbol in the input string. When set to `true`, this option takes precedence over `allowUnsafeSymbols` (i.e. setting the latter to `true` in such a case has no effect).

@@ -153,2 +153,13 @@ ```js

#### `allowUnsafeSymbols`
The default value for the `allowUnsafeSymbols` option is `false`. This means that characters that are unsafe for use in HTML content (`&`, `<`, `>`, `"`, `'`, and `` ` ``) will be encoded. When set to `true`, only non-ASCII characters will be encoded. If the `encodeEverything` option is set to `true`, this option will be ignored.
```js
he.encode('foo © and & ampersand', {
'allowUnsafeSymbols': true
});
// → 'foo &#xA9; and & ampersand'
```
#### Overriding default `encode` options globally

@@ -313,3 +324,3 @@

To generate [the code coverage report](http://rawgithub.com/mathiasbynens/he/master/coverage/he/he.js.html), use `grunt cover`.
To generate the code coverage report, use `grunt cover`.

@@ -324,3 +335,3 @@ ## Acknowledgements

|---|
| [Mathias Bynens](http://mathiasbynens.be/) |
| [Mathias Bynens](https://mathiasbynens.be/) |

@@ -327,0 +338,0 @@ ## License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc