Intial Commit
This commit is contained in:
commit
664c6d8ca3
5892 files changed
+759183
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+379
@@ -0,0 +1,379 @@
|
||||
# he [](https://travis-ci.org/mathiasbynens/he) [](https://codecov.io/github/mathiasbynens/he?branch=master) [](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](https://html.spec.whatwg.org/multipage/syntax.html#named-character-references), handles [ambiguous ampersands](https://mathiasbynens.be/notes/ambiguous-ampersands) and other edge cases [just like a browser would](https://html.spec.whatwg.org/multipage/syntax.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.](https://mothereff.in/html-entities)
|
||||
|
||||
## Installation
|
||||
|
||||
Via [npm](https://www.npmjs.com/):
|
||||
|
||||
```bash
|
||||
npm install he
|
||||
```
|
||||
|
||||
Via [Bower](http://bower.io/):
|
||||
|
||||
```bash
|
||||
bower install he
|
||||
```
|
||||
|
||||
Via [Component](https://github.com/component/component):
|
||||
|
||||
```bash
|
||||
component install mathiasbynens/he
|
||||
```
|
||||
|
||||
In a browser:
|
||||
|
||||
```html
|
||||
<script src="he.js"></script>
|
||||
```
|
||||
|
||||
In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var he = require('he');
|
||||
```
|
||||
|
||||
In [Rhino](http://www.mozilla.org/rhino/):
|
||||
|
||||
```js
|
||||
load('he.js');
|
||||
```
|
||||
|
||||
Using an AMD loader like [RequireJS](http://requirejs.org/):
|
||||
|
||||
```js
|
||||
require(
|
||||
{
|
||||
'paths': {
|
||||
'he': 'path/to/he'
|
||||
}
|
||||
},
|
||||
['he'],
|
||||
function(he) {
|
||||
console.log(he);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `he.version`
|
||||
|
||||
A string representing the semantic version number.
|
||||
|
||||
### `he.encode(text, options)`
|
||||
|
||||
This function takes a string of text and encodes (by default) any symbols that aren’t printable ASCII symbols and `&`, `<`, `>`, `"`, `'`, and `` ` ``, replacing them with character references.
|
||||
|
||||
```js
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux');
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
```
|
||||
|
||||
As long as the input string contains [allowed code points](https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream) only, the return value of this function is always valid HTML. Any [(invalid) code points that cannot be represented using a character reference](https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides) in the input are not encoded:
|
||||
|
||||
```js
|
||||
he.encode('foo \0 bar');
|
||||
// → 'foo \0 bar'
|
||||
```
|
||||
|
||||
However, enabling [the `strict` option](https://github.com/mathiasbynens/he#strict) causes invalid code points to throw an exception. With `strict` enabled, `he.encode` either throws (if the input contains invalid code points) or returns a string of valid HTML.
|
||||
|
||||
The `options` object is optional. It recognizes the following properties:
|
||||
|
||||
#### `useNamedReferences`
|
||||
|
||||
The default value for the `useNamedReferences` option is `false`. This means that `encode()` will not use any named character references (e.g. `©`) in the output — hexadecimal escapes (e.g. `©`) will be used instead. Set it to `true` to enable the use of named references.
|
||||
|
||||
**Note that if compatibility with older browsers is a concern, this option should remain disabled.**
|
||||
|
||||
```js
|
||||
// Using the global default setting (defaults to `false`):
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux');
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly disallow named references:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'useNamedReferences': false
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly allow named references:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'useNamedReferences': true
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
```
|
||||
|
||||
#### `decimal`
|
||||
|
||||
The default value for the `decimal` option is `false`. If the option is enabled, `encode` will generally use decimal escapes (e.g. `©`) rather than hexadecimal escapes (e.g. `©`). Beside of this replacement, the basic behavior remains the same when combined with other options. For example: if both options `useNamedReferences` and `decimal` are enabled, named references (e.g. `©`) are used over decimal escapes. HTML entities without a named reference are encoded using decimal escapes.
|
||||
|
||||
```js
|
||||
// Using the global default setting (defaults to `false`):
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux');
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly disable decimal escapes:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'decimal': false
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly enable decimal escapes:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'decimal': true
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly allow named references and decimal escapes:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'useNamedReferences': true,
|
||||
'decimal': true
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
```
|
||||
|
||||
#### `encodeEverything`
|
||||
|
||||
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).
|
||||
|
||||
```js
|
||||
// Using the global default setting (defaults to `false`):
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux');
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly encode all symbols:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'encodeEverything': true
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
|
||||
// This setting can be combined with the `useNamedReferences` option:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux', {
|
||||
'encodeEverything': true,
|
||||
'useNamedReferences': true
|
||||
});
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
```
|
||||
|
||||
#### `strict`
|
||||
|
||||
The default value for the `strict` option is `false`. This means that `encode()` will encode any HTML text content you feed it, even if it contains any symbols that cause [parse errors](https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream). To throw an error when such invalid HTML is encountered, set the `strict` option to `true`. This option makes it possible to use _he_ as part of HTML parsers and HTML validators.
|
||||
|
||||
```js
|
||||
// Using the global default setting (defaults to `false`, i.e. error-tolerant mode):
|
||||
he.encode('\x01');
|
||||
// → ''
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly enable error-tolerant mode:
|
||||
he.encode('\x01', {
|
||||
'strict': false
|
||||
});
|
||||
// → ''
|
||||
|
||||
// Passing an `options` object to `encode`, to explicitly enable strict mode:
|
||||
he.encode('\x01', {
|
||||
'strict': true
|
||||
});
|
||||
// → Parse error
|
||||
```
|
||||
|
||||
#### `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 © and & ampersand'
|
||||
```
|
||||
|
||||
#### Overriding default `encode` options globally
|
||||
|
||||
The global default setting can be overridden by modifying the `he.encode.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting.
|
||||
|
||||
```js
|
||||
// Read the global default setting:
|
||||
he.encode.options.useNamedReferences;
|
||||
// → `false` by default
|
||||
|
||||
// Override the global default setting:
|
||||
he.encode.options.useNamedReferences = true;
|
||||
|
||||
// Using the global default setting, which is now `true`:
|
||||
he.encode('foo © bar ≠ baz 𝌆 qux');
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
```
|
||||
|
||||
### `he.decode(html, options)`
|
||||
|
||||
This function takes a string of HTML and decodes any named and numerical character references in it using [the algorithm described in section 12.2.4.69 of the HTML spec](https://html.spec.whatwg.org/multipage/syntax.html#tokenizing-character-references).
|
||||
|
||||
```js
|
||||
he.decode('foo © bar ≠ baz 𝌆 qux');
|
||||
// → 'foo © bar ≠ baz 𝌆 qux'
|
||||
```
|
||||
|
||||
The `options` object is optional. It recognizes the following properties:
|
||||
|
||||
#### `isAttributeValue`
|
||||
|
||||
The default value for the `isAttributeValue` option is `false`. This means that `decode()` will decode the string as if it were used in [a text context in an HTML document](https://html.spec.whatwg.org/multipage/syntax.html#data-state). HTML has different rules for [parsing character references in attribute values](https://html.spec.whatwg.org/multipage/syntax.html#character-reference-in-attribute-value-state) — set this option to `true` to treat the input string as if it were used as an attribute value.
|
||||
|
||||
```js
|
||||
// Using the global default setting (defaults to `false`, i.e. HTML text context):
|
||||
he.decode('foo&bar');
|
||||
// → 'foo&bar'
|
||||
|
||||
// Passing an `options` object to `decode`, to explicitly assume an HTML text context:
|
||||
he.decode('foo&bar', {
|
||||
'isAttributeValue': false
|
||||
});
|
||||
// → 'foo&bar'
|
||||
|
||||
// Passing an `options` object to `decode`, to explicitly assume an HTML attribute value context:
|
||||
he.decode('foo&bar', {
|
||||
'isAttributeValue': true
|
||||
});
|
||||
// → 'foo&bar'
|
||||
```
|
||||
|
||||
#### `strict`
|
||||
|
||||
The default value for the `strict` option is `false`. This means that `decode()` will decode any HTML text content you feed it, even if it contains any entities that cause [parse errors](https://html.spec.whatwg.org/multipage/syntax.html#tokenizing-character-references). To throw an error when such invalid HTML is encountered, set the `strict` option to `true`. This option makes it possible to use _he_ as part of HTML parsers and HTML validators.
|
||||
|
||||
```js
|
||||
// Using the global default setting (defaults to `false`, i.e. error-tolerant mode):
|
||||
he.decode('foo&bar');
|
||||
// → 'foo&bar'
|
||||
|
||||
// Passing an `options` object to `decode`, to explicitly enable error-tolerant mode:
|
||||
he.decode('foo&bar', {
|
||||
'strict': false
|
||||
});
|
||||
// → 'foo&bar'
|
||||
|
||||
// Passing an `options` object to `decode`, to explicitly enable strict mode:
|
||||
he.decode('foo&bar', {
|
||||
'strict': true
|
||||
});
|
||||
// → Parse error
|
||||
```
|
||||
|
||||
#### Overriding default `decode` options globally
|
||||
|
||||
The global default settings for the `decode` function can be overridden by modifying the `he.decode.options` object. This saves you from passing in an `options` object for every call to `decode` if you want to use a non-default setting.
|
||||
|
||||
```js
|
||||
// Read the global default setting:
|
||||
he.decode.options.isAttributeValue;
|
||||
// → `false` by default
|
||||
|
||||
// Override the global default setting:
|
||||
he.decode.options.isAttributeValue = true;
|
||||
|
||||
// Using the global default setting, which is now `true`:
|
||||
he.decode('foo&bar');
|
||||
// → 'foo&bar'
|
||||
```
|
||||
|
||||
### `he.escape(text)`
|
||||
|
||||
This function takes a string of text and escapes it for use in text contexts in XML or HTML documents. Only the following characters are escaped: `&`, `<`, `>`, `"`, `'`, and `` ` ``.
|
||||
|
||||
```js
|
||||
he.escape('<img src=\'x\' onerror="prompt(1)">');
|
||||
// → '<img src='x' onerror="prompt(1)">'
|
||||
```
|
||||
|
||||
### `he.unescape(html, options)`
|
||||
|
||||
`he.unescape` is an alias for `he.decode`. It takes a string of HTML and decodes any named and numerical character references in it.
|
||||
|
||||
### Using the `he` binary
|
||||
|
||||
To use the `he` binary in your shell, simply install _he_ globally using npm:
|
||||
|
||||
```bash
|
||||
npm install -g he
|
||||
```
|
||||
|
||||
After that you will be able to encode/decode HTML entities from the command line:
|
||||
|
||||
```bash
|
||||
$ he --encode 'föo ♥ bår 𝌆 baz'
|
||||
föo ♥ bår 𝌆 baz
|
||||
|
||||
$ he --encode --use-named-refs 'föo ♥ bår 𝌆 baz'
|
||||
föo ♥ bår 𝌆 baz
|
||||
|
||||
$ he --decode 'föo ♥ bår 𝌆 baz'
|
||||
föo ♥ bår 𝌆 baz
|
||||
```
|
||||
|
||||
Read a local text file, encode it for use in an HTML text context, and save the result to a new file:
|
||||
|
||||
```bash
|
||||
$ he --encode < foo.txt > foo-escaped.html
|
||||
```
|
||||
|
||||
Or do the same with an online text file:
|
||||
|
||||
```bash
|
||||
$ curl -sL "http://git.io/HnfEaw" | he --encode > escaped.html
|
||||
```
|
||||
|
||||
Or, the opposite — read a local file containing a snippet of HTML in a text context, decode it back to plain text, and save the result to a new file:
|
||||
|
||||
```bash
|
||||
$ he --decode < foo-escaped.html > foo.txt
|
||||
```
|
||||
|
||||
Or do the same with an online HTML snippet:
|
||||
|
||||
```bash
|
||||
$ curl -sL "http://git.io/HnfEaw" | he --decode > decoded.txt
|
||||
```
|
||||
|
||||
See `he --help` for the full list of options.
|
||||
|
||||
## Support
|
||||
|
||||
_he_ has been tested in at least:
|
||||
|
||||
* Chrome 27-50
|
||||
* Firefox 3-45
|
||||
* Safari 4-9
|
||||
* Opera 10-12, 15–37
|
||||
* IE 6–11
|
||||
* Edge
|
||||
* Narwhal 0.3.2
|
||||
* Node.js v0.10, v0.12, v4, v5
|
||||
* PhantomJS 1.9.0
|
||||
* Rhino 1.7RC4
|
||||
* RingoJS 0.8-0.11
|
||||
|
||||
## Unit tests & code coverage
|
||||
|
||||
After cloning this repository, run `npm install` to install the dependencies needed for he development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.
|
||||
|
||||
Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.
|
||||
|
||||
To generate the code coverage report, use `grunt cover`.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Thanks to [Simon Pieters](https://simon.html5.org/) ([@zcorpan](https://twitter.com/zcorpan)) for the many suggestions.
|
||||
|
||||
## Author
|
||||
|
||||
| [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|
|
||||
| [Mathias Bynens](https://mathiasbynens.be/) |
|
||||
|
||||
## License
|
||||
|
||||
_he_ is available under the [MIT](https://mths.be/mit) license.
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
#!/usr/bin/env node
|
||||
(function() {
|
||||
|
||||
var fs = require('fs');
|
||||
var he = require('../he.js');
|
||||
var strings = process.argv.splice(2);
|
||||
var stdin = process.stdin;
|
||||
var data;
|
||||
var timeout;
|
||||
var action;
|
||||
var options = {};
|
||||
var log = console.log;
|
||||
|
||||
var main = function() {
|
||||
var option = strings[0];
|
||||
var count = 0;
|
||||
|
||||
if (/^(?:-h|--help|undefined)$/.test(option)) {
|
||||
log(
|
||||
'he v%s - https://mths.be/he',
|
||||
he.version
|
||||
);
|
||||
log([
|
||||
'\nUsage:\n',
|
||||
'\the [--escape] string',
|
||||
'\the [--encode] [--use-named-refs] [--everything] [--allow-unsafe] [--decimal] string',
|
||||
'\the [--decode] [--attribute] [--strict] string',
|
||||
'\the [-v | --version]',
|
||||
'\the [-h | --help]',
|
||||
'\nExamples:\n',
|
||||
'\the --escape \\<img\\ src\\=\\\'x\\\'\\ onerror\\=\\"prompt\\(1\\)\\"\\>',
|
||||
'\techo \'© 𝌆\' | he --decode'
|
||||
].join('\n'));
|
||||
return process.exit(option ? 0 : 1);
|
||||
}
|
||||
|
||||
if (/^(?:-v|--version)$/.test(option)) {
|
||||
log('v%s', he.version);
|
||||
return process.exit(0);
|
||||
}
|
||||
|
||||
strings.forEach(function(string) {
|
||||
// Process options
|
||||
if (string == '--escape') {
|
||||
action = 'escape';
|
||||
return;
|
||||
}
|
||||
if (string == '--encode') {
|
||||
action = 'encode';
|
||||
return;
|
||||
}
|
||||
if (string == '--use-named-refs') {
|
||||
action = 'encode';
|
||||
options.useNamedReferences = true;
|
||||
return;
|
||||
}
|
||||
if (string == '--everything') {
|
||||
action = 'encode';
|
||||
options.encodeEverything = true;
|
||||
return;
|
||||
}
|
||||
if (string == '--allow-unsafe') {
|
||||
action = 'encode';
|
||||
options.allowUnsafeSymbols = true;
|
||||
return;
|
||||
}
|
||||
if (string == '--decimal') {
|
||||
action = 'encode';
|
||||
options.decimal = true;
|
||||
return;
|
||||
}
|
||||
if (string == '--decode') {
|
||||
action = 'decode';
|
||||
return;
|
||||
}
|
||||
if (string == '--attribute') {
|
||||
action = 'decode';
|
||||
options.isAttributeValue = true;
|
||||
return;
|
||||
}
|
||||
if (string == '--strict') {
|
||||
action = 'decode';
|
||||
options.strict = true;
|
||||
return;
|
||||
}
|
||||
// Process string(s)
|
||||
var result;
|
||||
if (!action) {
|
||||
log('Error: he requires at least one option and a string argument.');
|
||||
log('Try `he --help` for more information.');
|
||||
return process.exit(1);
|
||||
}
|
||||
try {
|
||||
result = he[action](string, options);
|
||||
log(result);
|
||||
count++;
|
||||
} catch(error) {
|
||||
log(error.message + '\n');
|
||||
log('Error: failed to %s.', action);
|
||||
log('If you think this is a bug in he, please report it:');
|
||||
log('https://github.com/mathiasbynens/he/issues/new');
|
||||
log(
|
||||
'\nStack trace using he@%s:\n',
|
||||
he.version
|
||||
);
|
||||
log(error.stack);
|
||||
return process.exit(1);
|
||||
}
|
||||
});
|
||||
if (!count) {
|
||||
log('Error: he requires a string argument.');
|
||||
log('Try `he --help` for more information.');
|
||||
return process.exit(1);
|
||||
}
|
||||
// Return with exit status 0 outside of the `forEach` loop, in case
|
||||
// multiple strings were passed in.
|
||||
return process.exit(0);
|
||||
};
|
||||
|
||||
if (stdin.isTTY) {
|
||||
// handle shell arguments
|
||||
main();
|
||||
} else {
|
||||
// Either the script is called from within a non-TTY context, or `stdin`
|
||||
// content is being piped in.
|
||||
if (!process.stdout.isTTY) {
|
||||
// The script was called from a non-TTY context. This is a rather uncommon
|
||||
// use case we don’t actively support. However, we don’t want the script
|
||||
// to wait forever in such cases, so…
|
||||
timeout = setTimeout(function() {
|
||||
// …if no piped data arrived after a whole minute, handle shell
|
||||
// arguments instead.
|
||||
main();
|
||||
}, 60000);
|
||||
}
|
||||
data = '';
|
||||
stdin.on('data', function(chunk) {
|
||||
clearTimeout(timeout);
|
||||
data += chunk;
|
||||
});
|
||||
stdin.on('end', function() {
|
||||
strings.push(data.trim());
|
||||
main();
|
||||
});
|
||||
stdin.resume();
|
||||
}
|
||||
|
||||
}());
|
||||
+345
@@ -0,0 +1,345 @@
|
||||
/*! https://mths.be/he v1.2.0 by @mathias | MIT license */
|
||||
;(function(root) {
|
||||
|
||||
// Detect free variables `exports`.
|
||||
var freeExports = typeof exports == 'object' && exports;
|
||||
|
||||
// Detect free variable `module`.
|
||||
var freeModule = typeof module == 'object' && module &&
|
||||
module.exports == freeExports && module;
|
||||
|
||||
// Detect free variable `global`, from Node.js or Browserified code,
|
||||
// and use it as `root`.
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
root = freeGlobal;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// All astral symbols.
|
||||
var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
||||
// All ASCII symbols (not just printable ASCII) except those listed in the
|
||||
// first column of the overrides table.
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides
|
||||
var regexAsciiWhitelist = /[\x01-\x7F]/g;
|
||||
// All BMP symbols that are not ASCII newlines, printable ASCII symbols, or
|
||||
// code points listed in the first column of the overrides table on
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides.
|
||||
var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;
|
||||
|
||||
var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;
|
||||
var encodeMap = {'\xAD':'shy','\u200C':'zwnj','\u200D':'zwj','\u200E':'lrm','\u2063':'ic','\u2062':'it','\u2061':'af','\u200F':'rlm','\u200B':'ZeroWidthSpace','\u2060':'NoBreak','\u0311':'DownBreve','\u20DB':'tdot','\u20DC':'DotDot','\t':'Tab','\n':'NewLine','\u2008':'puncsp','\u205F':'MediumSpace','\u2009':'thinsp','\u200A':'hairsp','\u2004':'emsp13','\u2002':'ensp','\u2005':'emsp14','\u2003':'emsp','\u2007':'numsp','\xA0':'nbsp','\u205F\u200A':'ThickSpace','\u203E':'oline','_':'lowbar','\u2010':'dash','\u2013':'ndash','\u2014':'mdash','\u2015':'horbar',',':'comma',';':'semi','\u204F':'bsemi',':':'colon','\u2A74':'Colone','!':'excl','\xA1':'iexcl','?':'quest','\xBF':'iquest','.':'period','\u2025':'nldr','\u2026':'mldr','\xB7':'middot','\'':'apos','\u2018':'lsquo','\u2019':'rsquo','\u201A':'sbquo','\u2039':'lsaquo','\u203A':'rsaquo','"':'quot','\u201C':'ldquo','\u201D':'rdquo','\u201E':'bdquo','\xAB':'laquo','\xBB':'raquo','(':'lpar',')':'rpar','[':'lsqb',']':'rsqb','{':'lcub','}':'rcub','\u2308':'lceil','\u2309':'rceil','\u230A':'lfloor','\u230B':'rfloor','\u2985':'lopar','\u2986':'ropar','\u298B':'lbrke','\u298C':'rbrke','\u298D':'lbrkslu','\u298E':'rbrksld','\u298F':'lbrksld','\u2990':'rbrkslu','\u2991':'langd','\u2992':'rangd','\u2993':'lparlt','\u2994':'rpargt','\u2995':'gtlPar','\u2996':'ltrPar','\u27E6':'lobrk','\u27E7':'robrk','\u27E8':'lang','\u27E9':'rang','\u27EA':'Lang','\u27EB':'Rang','\u27EC':'loang','\u27ED':'roang','\u2772':'lbbrk','\u2773':'rbbrk','\u2016':'Vert','\xA7':'sect','\xB6':'para','@':'commat','*':'ast','/':'sol','undefined':null,'&':'amp','#':'num','%':'percnt','\u2030':'permil','\u2031':'pertenk','\u2020':'dagger','\u2021':'Dagger','\u2022':'bull','\u2043':'hybull','\u2032':'prime','\u2033':'Prime','\u2034':'tprime','\u2057':'qprime','\u2035':'bprime','\u2041':'caret','`':'grave','\xB4':'acute','\u02DC':'tilde','^':'Hat','\xAF':'macr','\u02D8':'breve','\u02D9':'dot','\xA8':'die','\u02DA':'ring','\u02DD':'dblac','\xB8':'cedil','\u02DB':'ogon','\u02C6':'circ','\u02C7':'caron','\xB0':'deg','\xA9':'copy','\xAE':'reg','\u2117':'copysr','\u2118':'wp','\u211E':'rx','\u2127':'mho','\u2129':'iiota','\u2190':'larr','\u219A':'nlarr','\u2192':'rarr','\u219B':'nrarr','\u2191':'uarr','\u2193':'darr','\u2194':'harr','\u21AE':'nharr','\u2195':'varr','\u2196':'nwarr','\u2197':'nearr','\u2198':'searr','\u2199':'swarr','\u219D':'rarrw','\u219D\u0338':'nrarrw','\u219E':'Larr','\u219F':'Uarr','\u21A0':'Rarr','\u21A1':'Darr','\u21A2':'larrtl','\u21A3':'rarrtl','\u21A4':'mapstoleft','\u21A5':'mapstoup','\u21A6':'map','\u21A7':'mapstodown','\u21A9':'larrhk','\u21AA':'rarrhk','\u21AB':'larrlp','\u21AC':'rarrlp','\u21AD':'harrw','\u21B0':'lsh','\u21B1':'rsh','\u21B2':'ldsh','\u21B3':'rdsh','\u21B5':'crarr','\u21B6':'cularr','\u21B7':'curarr','\u21BA':'olarr','\u21BB':'orarr','\u21BC':'lharu','\u21BD':'lhard','\u21BE':'uharr','\u21BF':'uharl','\u21C0':'rharu','\u21C1':'rhard','\u21C2':'dharr','\u21C3':'dharl','\u21C4':'rlarr','\u21C5':'udarr','\u21C6':'lrarr','\u21C7':'llarr','\u21C8':'uuarr','\u21C9':'rrarr','\u21CA':'ddarr','\u21CB':'lrhar','\u21CC':'rlhar','\u21D0':'lArr','\u21CD':'nlArr','\u21D1':'uArr','\u21D2':'rArr','\u21CF':'nrArr','\u21D3':'dArr','\u21D4':'iff','\u21CE':'nhArr','\u21D5':'vArr','\u21D6':'nwArr','\u21D7':'neArr','\u21D8':'seArr','\u21D9':'swArr','\u21DA':'lAarr','\u21DB':'rAarr','\u21DD':'zigrarr','\u21E4':'larrb','\u21E5':'rarrb','\u21F5':'duarr','\u21FD':'loarr','\u21FE':'roarr','\u21FF':'hoarr','\u2200':'forall','\u2201':'comp','\u2202':'part','\u2202\u0338':'npart','\u2203':'exist','\u2204':'nexist','\u2205':'empty','\u2207':'Del','\u2208':'in','\u2209':'notin','\u220B':'ni','\u220C':'notni','\u03F6':'bepsi','\u220F':'prod','\u2210':'coprod','\u2211':'sum','+':'plus','\xB1':'pm','\xF7':'div','\xD7':'times','<':'lt','\u226E':'nlt','<\u20D2':'nvlt','=':'equals','\u2260':'ne','=\u20E5':'bne','\u2A75':'Equal','>':'gt','\u226F':'ngt','>\u20D2':'nvgt','\xAC':'not','|':'vert','\xA6':'brvbar','\u2212':'minus','\u2213':'mp','\u2214':'plusdo','\u2044':'frasl','\u2216':'setmn','\u2217':'lowast','\u2218':'compfn','\u221A':'Sqrt','\u221D':'prop','\u221E':'infin','\u221F':'angrt','\u2220':'ang','\u2220\u20D2':'nang','\u2221':'angmsd','\u2222':'angsph','\u2223':'mid','\u2224':'nmid','\u2225':'par','\u2226':'npar','\u2227':'and','\u2228':'or','\u2229':'cap','\u2229\uFE00':'caps','\u222A':'cup','\u222A\uFE00':'cups','\u222B':'int','\u222C':'Int','\u222D':'tint','\u2A0C':'qint','\u222E':'oint','\u222F':'Conint','\u2230':'Cconint','\u2231':'cwint','\u2232':'cwconint','\u2233':'awconint','\u2234':'there4','\u2235':'becaus','\u2236':'ratio','\u2237':'Colon','\u2238':'minusd','\u223A':'mDDot','\u223B':'homtht','\u223C':'sim','\u2241':'nsim','\u223C\u20D2':'nvsim','\u223D':'bsim','\u223D\u0331':'race','\u223E':'ac','\u223E\u0333':'acE','\u223F':'acd','\u2240':'wr','\u2242':'esim','\u2242\u0338':'nesim','\u2243':'sime','\u2244':'nsime','\u2245':'cong','\u2247':'ncong','\u2246':'simne','\u2248':'ap','\u2249':'nap','\u224A':'ape','\u224B':'apid','\u224B\u0338':'napid','\u224C':'bcong','\u224D':'CupCap','\u226D':'NotCupCap','\u224D\u20D2':'nvap','\u224E':'bump','\u224E\u0338':'nbump','\u224F':'bumpe','\u224F\u0338':'nbumpe','\u2250':'doteq','\u2250\u0338':'nedot','\u2251':'eDot','\u2252':'efDot','\u2253':'erDot','\u2254':'colone','\u2255':'ecolon','\u2256':'ecir','\u2257':'cire','\u2259':'wedgeq','\u225A':'veeeq','\u225C':'trie','\u225F':'equest','\u2261':'equiv','\u2262':'nequiv','\u2261\u20E5':'bnequiv','\u2264':'le','\u2270':'nle','\u2264\u20D2':'nvle','\u2265':'ge','\u2271':'nge','\u2265\u20D2':'nvge','\u2266':'lE','\u2266\u0338':'nlE','\u2267':'gE','\u2267\u0338':'ngE','\u2268\uFE00':'lvnE','\u2268':'lnE','\u2269':'gnE','\u2269\uFE00':'gvnE','\u226A':'ll','\u226A\u0338':'nLtv','\u226A\u20D2':'nLt','\u226B':'gg','\u226B\u0338':'nGtv','\u226B\u20D2':'nGt','\u226C':'twixt','\u2272':'lsim','\u2274':'nlsim','\u2273':'gsim','\u2275':'ngsim','\u2276':'lg','\u2278':'ntlg','\u2277':'gl','\u2279':'ntgl','\u227A':'pr','\u2280':'npr','\u227B':'sc','\u2281':'nsc','\u227C':'prcue','\u22E0':'nprcue','\u227D':'sccue','\u22E1':'nsccue','\u227E':'prsim','\u227F':'scsim','\u227F\u0338':'NotSucceedsTilde','\u2282':'sub','\u2284':'nsub','\u2282\u20D2':'vnsub','\u2283':'sup','\u2285':'nsup','\u2283\u20D2':'vnsup','\u2286':'sube','\u2288':'nsube','\u2287':'supe','\u2289':'nsupe','\u228A\uFE00':'vsubne','\u228A':'subne','\u228B\uFE00':'vsupne','\u228B':'supne','\u228D':'cupdot','\u228E':'uplus','\u228F':'sqsub','\u228F\u0338':'NotSquareSubset','\u2290':'sqsup','\u2290\u0338':'NotSquareSuperset','\u2291':'sqsube','\u22E2':'nsqsube','\u2292':'sqsupe','\u22E3':'nsqsupe','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u2295':'oplus','\u2296':'ominus','\u2297':'otimes','\u2298':'osol','\u2299':'odot','\u229A':'ocir','\u229B':'oast','\u229D':'odash','\u229E':'plusb','\u229F':'minusb','\u22A0':'timesb','\u22A1':'sdotb','\u22A2':'vdash','\u22AC':'nvdash','\u22A3':'dashv','\u22A4':'top','\u22A5':'bot','\u22A7':'models','\u22A8':'vDash','\u22AD':'nvDash','\u22A9':'Vdash','\u22AE':'nVdash','\u22AA':'Vvdash','\u22AB':'VDash','\u22AF':'nVDash','\u22B0':'prurel','\u22B2':'vltri','\u22EA':'nltri','\u22B3':'vrtri','\u22EB':'nrtri','\u22B4':'ltrie','\u22EC':'nltrie','\u22B4\u20D2':'nvltrie','\u22B5':'rtrie','\u22ED':'nrtrie','\u22B5\u20D2':'nvrtrie','\u22B6':'origof','\u22B7':'imof','\u22B8':'mumap','\u22B9':'hercon','\u22BA':'intcal','\u22BB':'veebar','\u22BD':'barvee','\u22BE':'angrtvb','\u22BF':'lrtri','\u22C0':'Wedge','\u22C1':'Vee','\u22C2':'xcap','\u22C3':'xcup','\u22C4':'diam','\u22C5':'sdot','\u22C6':'Star','\u22C7':'divonx','\u22C8':'bowtie','\u22C9':'ltimes','\u22CA':'rtimes','\u22CB':'lthree','\u22CC':'rthree','\u22CD':'bsime','\u22CE':'cuvee','\u22CF':'cuwed','\u22D0':'Sub','\u22D1':'Sup','\u22D2':'Cap','\u22D3':'Cup','\u22D4':'fork','\u22D5':'epar','\u22D6':'ltdot','\u22D7':'gtdot','\u22D8':'Ll','\u22D8\u0338':'nLl','\u22D9':'Gg','\u22D9\u0338':'nGg','\u22DA\uFE00':'lesg','\u22DA':'leg','\u22DB':'gel','\u22DB\uFE00':'gesl','\u22DE':'cuepr','\u22DF':'cuesc','\u22E6':'lnsim','\u22E7':'gnsim','\u22E8':'prnsim','\u22E9':'scnsim','\u22EE':'vellip','\u22EF':'ctdot','\u22F0':'utdot','\u22F1':'dtdot','\u22F2':'disin','\u22F3':'isinsv','\u22F4':'isins','\u22F5':'isindot','\u22F5\u0338':'notindot','\u22F6':'notinvc','\u22F7':'notinvb','\u22F9':'isinE','\u22F9\u0338':'notinE','\u22FA':'nisd','\u22FB':'xnis','\u22FC':'nis','\u22FD':'notnivc','\u22FE':'notnivb','\u2305':'barwed','\u2306':'Barwed','\u230C':'drcrop','\u230D':'dlcrop','\u230E':'urcrop','\u230F':'ulcrop','\u2310':'bnot','\u2312':'profline','\u2313':'profsurf','\u2315':'telrec','\u2316':'target','\u231C':'ulcorn','\u231D':'urcorn','\u231E':'dlcorn','\u231F':'drcorn','\u2322':'frown','\u2323':'smile','\u232D':'cylcty','\u232E':'profalar','\u2336':'topbot','\u233D':'ovbar','\u233F':'solbar','\u237C':'angzarr','\u23B0':'lmoust','\u23B1':'rmoust','\u23B4':'tbrk','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u23DC':'OverParenthesis','\u23DD':'UnderParenthesis','\u23DE':'OverBrace','\u23DF':'UnderBrace','\u23E2':'trpezium','\u23E7':'elinters','\u2423':'blank','\u2500':'boxh','\u2502':'boxv','\u250C':'boxdr','\u2510':'boxdl','\u2514':'boxur','\u2518':'boxul','\u251C':'boxvr','\u2524':'boxvl','\u252C':'boxhd','\u2534':'boxhu','\u253C':'boxvh','\u2550':'boxH','\u2551':'boxV','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2580':'uhblk','\u2584':'lhblk','\u2588':'block','\u2591':'blk14','\u2592':'blk12','\u2593':'blk34','\u25A1':'squ','\u25AA':'squf','\uLine truncated
|
||||
|
||||
var regexEscape = /["&'<>`]/g;
|
||||
var escapeMap = {
|
||||
'"': '"',
|
||||
'&': '&',
|
||||
'\'': ''',
|
||||
'<': '<',
|
||||
// See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the
|
||||
// following is not strictly necessary unless it’s part of a tag or an
|
||||
// unquoted attribute value. We’re only escaping it to support those
|
||||
// situations, and for XML support.
|
||||
'>': '>',
|
||||
// In Internet Explorer ≤ 8, the backtick character can be used
|
||||
// to break out of (un)quoted attribute values or HTML comments.
|
||||
// See http://html5sec.org/#102, http://html5sec.org/#108, and
|
||||
// http://html5sec.org/#133.
|
||||
'`': '`'
|
||||
};
|
||||
|
||||
var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;
|
||||
var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
||||
var regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capLine truncated
|
||||
var decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'Line truncated
|
||||
var decodeMapLegacy = {'aacute':'\xE1','Aacute':'\xC1','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','aelig':'\xE6','AElig':'\xC6','agrave':'\xE0','Agrave':'\xC0','amp':'&','AMP':'&','aring':'\xE5','Aring':'\xC5','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','brvbar':'\xA6','ccedil':'\xE7','Ccedil':'\xC7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','eacute':'\xE9','Eacute':'\xC9','ecirc':'\xEA','Ecirc':'\xCA','egrave':'\xE8','Egrave':'\xC8','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','iacute':'\xED','Iacute':'\xCD','icirc':'\xEE','Icirc':'\xCE','iexcl':'\xA1','igrave':'\xEC','Igrave':'\xCC','iquest':'\xBF','iuml':'\xEF','Iuml':'\xCF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','ntilde':'\xF1','Ntilde':'\xD1','oacute':'\xF3','Oacute':'\xD3','ocirc':'\xF4','Ocirc':'\xD4','ograve':'\xF2','Ograve':'\xD2','ordf':'\xAA','ordm':'\xBA','oslash':'\xF8','Oslash':'\xD8','otilde':'\xF5','Otilde':'\xD5','ouml':'\xF6','Ouml':'\xD6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','thorn':'\xFE','THORN':'\xDE','times':'\xD7','uacute':'\xFA','Uacute':'\xDA','ucirc':'\xFB','Ucirc':'\xDB','ugrave':'\xF9','Ugrave':'\xD9','uml':'\xA8','uuml':'\xFC','Uuml':'\xDC','yacute':'\xFD','Yacute':'\xDD','yen':'\xA5','yuml':'\xFF'};
|
||||
var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'};
|
||||
var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var stringFromCharCode = String.fromCharCode;
|
||||
|
||||
var object = {};
|
||||
var hasOwnProperty = object.hasOwnProperty;
|
||||
var has = function(object, propertyName) {
|
||||
return hasOwnProperty.call(object, propertyName);
|
||||
};
|
||||
|
||||
var contains = function(array, value) {
|
||||
var index = -1;
|
||||
var length = array.length;
|
||||
while (++index < length) {
|
||||
if (array[index] == value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
var merge = function(options, defaults) {
|
||||
if (!options) {
|
||||
return defaults;
|
||||
}
|
||||
var result = {};
|
||||
var key;
|
||||
for (key in defaults) {
|
||||
// A `hasOwnProperty` check is not needed here, since only recognized
|
||||
// option names are used anyway. Any others are ignored.
|
||||
result[key] = has(options, key) ? options[key] : defaults[key];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
// Modified version of `ucs2encode`; see https://mths.be/punycode.
|
||||
var codePointToSymbol = function(codePoint, strict) {
|
||||
var output = '';
|
||||
if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) {
|
||||
// See issue #4:
|
||||
// “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is
|
||||
// greater than 0x10FFFF, then this is a parse error. Return a U+FFFD
|
||||
// REPLACEMENT CHARACTER.”
|
||||
if (strict) {
|
||||
parseError('character reference outside the permissible Unicode range');
|
||||
}
|
||||
return '\uFFFD';
|
||||
}
|
||||
if (has(decodeMapNumeric, codePoint)) {
|
||||
if (strict) {
|
||||
parseError('disallowed character reference');
|
||||
}
|
||||
return decodeMapNumeric[codePoint];
|
||||
}
|
||||
if (strict && contains(invalidReferenceCodePoints, codePoint)) {
|
||||
parseError('disallowed character reference');
|
||||
}
|
||||
if (codePoint > 0xFFFF) {
|
||||
codePoint -= 0x10000;
|
||||
output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
|
||||
codePoint = 0xDC00 | codePoint & 0x3FF;
|
||||
}
|
||||
output += stringFromCharCode(codePoint);
|
||||
return output;
|
||||
};
|
||||
|
||||
var hexEscape = function(codePoint) {
|
||||
return '&#x' + codePoint.toString(16).toUpperCase() + ';';
|
||||
};
|
||||
|
||||
var decEscape = function(codePoint) {
|
||||
return '&#' + codePoint + ';';
|
||||
};
|
||||
|
||||
var parseError = function(message) {
|
||||
throw Error('Parse error: ' + message);
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var encode = function(string, options) {
|
||||
options = merge(options, encode.options);
|
||||
var strict = options.strict;
|
||||
if (strict && regexInvalidRawCodePoint.test(string)) {
|
||||
parseError('forbidden code point');
|
||||
}
|
||||
var encodeEverything = options.encodeEverything;
|
||||
var useNamedReferences = options.useNamedReferences;
|
||||
var allowUnsafeSymbols = options.allowUnsafeSymbols;
|
||||
var escapeCodePoint = options.decimal ? decEscape : hexEscape;
|
||||
|
||||
var escapeBmpSymbol = function(symbol) {
|
||||
return escapeCodePoint(symbol.charCodeAt(0));
|
||||
};
|
||||
|
||||
if (encodeEverything) {
|
||||
// Encode ASCII symbols.
|
||||
string = string.replace(regexAsciiWhitelist, function(symbol) {
|
||||
// Use named references if requested & possible.
|
||||
if (useNamedReferences && has(encodeMap, symbol)) {
|
||||
return '&' + encodeMap[symbol] + ';';
|
||||
}
|
||||
return escapeBmpSymbol(symbol);
|
||||
});
|
||||
// Shorten a few escapes that represent two symbols, of which at least one
|
||||
// is within the ASCII range.
|
||||
if (useNamedReferences) {
|
||||
string = string
|
||||
.replace(/>\u20D2/g, '>⃒')
|
||||
.replace(/<\u20D2/g, '<⃒')
|
||||
.replace(/fj/g, 'fj');
|
||||
}
|
||||
// Encode non-ASCII symbols.
|
||||
if (useNamedReferences) {
|
||||
// Encode non-ASCII symbols that can be replaced with a named reference.
|
||||
string = string.replace(regexEncodeNonAscii, function(string) {
|
||||
// Note: there is no need to check `has(encodeMap, string)` here.
|
||||
return '&' + encodeMap[string] + ';';
|
||||
});
|
||||
}
|
||||
// Note: any remaining non-ASCII symbols are handled outside of the `if`.
|
||||
} else if (useNamedReferences) {
|
||||
// Apply named character references.
|
||||
// Encode `<>"'&` using named character references.
|
||||
if (!allowUnsafeSymbols) {
|
||||
string = string.replace(regexEscape, function(string) {
|
||||
return '&' + encodeMap[string] + ';'; // no need to check `has()` here
|
||||
});
|
||||
}
|
||||
// Shorten escapes that represent two symbols, of which at least one is
|
||||
// `<>"'&`.
|
||||
string = string
|
||||
.replace(/>\u20D2/g, '>⃒')
|
||||
.replace(/<\u20D2/g, '<⃒');
|
||||
// Encode non-ASCII symbols that can be replaced with a named reference.
|
||||
string = string.replace(regexEncodeNonAscii, function(string) {
|
||||
// Note: there is no need to check `has(encodeMap, string)` here.
|
||||
return '&' + encodeMap[string] + ';';
|
||||
});
|
||||
} else if (!allowUnsafeSymbols) {
|
||||
// Encode `<>"'&` using hexadecimal escapes, now that they’re not handled
|
||||
// using named character references.
|
||||
string = string.replace(regexEscape, escapeBmpSymbol);
|
||||
}
|
||||
return string
|
||||
// Encode astral symbols.
|
||||
.replace(regexAstralSymbols, function($0) {
|
||||
// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
var high = $0.charCodeAt(0);
|
||||
var low = $0.charCodeAt(1);
|
||||
var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
|
||||
return escapeCodePoint(codePoint);
|
||||
})
|
||||
// Encode any remaining BMP symbols that are not printable ASCII symbols
|
||||
// using a hexadecimal escape.
|
||||
.replace(regexBmpWhitelist, escapeBmpSymbol);
|
||||
};
|
||||
// Expose default options (so they can be overridden globally).
|
||||
encode.options = {
|
||||
'allowUnsafeSymbols': false,
|
||||
'encodeEverything': false,
|
||||
'strict': false,
|
||||
'useNamedReferences': false,
|
||||
'decimal' : false
|
||||
};
|
||||
|
||||
var decode = function(html, options) {
|
||||
options = merge(options, decode.options);
|
||||
var strict = options.strict;
|
||||
if (strict && regexInvalidEntity.test(html)) {
|
||||
parseError('malformed character reference');
|
||||
}
|
||||
return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7, $8) {
|
||||
var codePoint;
|
||||
var semicolon;
|
||||
var decDigits;
|
||||
var hexDigits;
|
||||
var reference;
|
||||
var next;
|
||||
|
||||
if ($1) {
|
||||
reference = $1;
|
||||
// Note: there is no need to check `has(decodeMap, reference)`.
|
||||
return decodeMap[reference];
|
||||
}
|
||||
|
||||
if ($2) {
|
||||
// Decode named character references without trailing `;`, e.g. `&`.
|
||||
// This is only a parse error if it gets converted to `&`, or if it is
|
||||
// followed by `=` in an attribute context.
|
||||
reference = $2;
|
||||
next = $3;
|
||||
if (next && options.isAttributeValue) {
|
||||
if (strict && next == '=') {
|
||||
parseError('`&` did not start a character reference');
|
||||
}
|
||||
return $0;
|
||||
} else {
|
||||
if (strict) {
|
||||
parseError(
|
||||
'named character reference was not terminated by a semicolon'
|
||||
);
|
||||
}
|
||||
// Note: there is no need to check `has(decodeMapLegacy, reference)`.
|
||||
return decodeMapLegacy[reference] + (next || '');
|
||||
}
|
||||
}
|
||||
|
||||
if ($4) {
|
||||
// Decode decimal escapes, e.g. `𝌆`.
|
||||
decDigits = $4;
|
||||
semicolon = $5;
|
||||
if (strict && !semicolon) {
|
||||
parseError('character reference was not terminated by a semicolon');
|
||||
}
|
||||
codePoint = parseInt(decDigits, 10);
|
||||
return codePointToSymbol(codePoint, strict);
|
||||
}
|
||||
|
||||
if ($6) {
|
||||
// Decode hexadecimal escapes, e.g. `𝌆`.
|
||||
hexDigits = $6;
|
||||
semicolon = $7;
|
||||
if (strict && !semicolon) {
|
||||
parseError('character reference was not terminated by a semicolon');
|
||||
}
|
||||
codePoint = parseInt(hexDigits, 16);
|
||||
return codePointToSymbol(codePoint, strict);
|
||||
}
|
||||
|
||||
// If we’re still here, `if ($7)` is implied; it’s an ambiguous
|
||||
// ampersand for sure. https://mths.be/notes/ambiguous-ampersands
|
||||
if (strict) {
|
||||
parseError(
|
||||
'named character reference was not terminated by a semicolon'
|
||||
);
|
||||
}
|
||||
return $0;
|
||||
});
|
||||
};
|
||||
// Expose default options (so they can be overridden globally).
|
||||
decode.options = {
|
||||
'isAttributeValue': false,
|
||||
'strict': false
|
||||
};
|
||||
|
||||
var escape = function(string) {
|
||||
return string.replace(regexEscape, function($0) {
|
||||
// Note: there is no need to check `has(escapeMap, $0)` here.
|
||||
return escapeMap[$0];
|
||||
});
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
var he = {
|
||||
'version': '1.2.0',
|
||||
'encode': encode,
|
||||
'decode': decode,
|
||||
'escape': escape,
|
||||
'unescape': decode
|
||||
};
|
||||
|
||||
// Some AMD build optimizers, like r.js, check for specific condition patterns
|
||||
// like the following:
|
||||
if (
|
||||
typeof define == 'function' &&
|
||||
typeof define.amd == 'object' &&
|
||||
define.amd
|
||||
) {
|
||||
define(function() {
|
||||
return he;
|
||||
});
|
||||
} else if (freeExports && !freeExports.nodeType) {
|
||||
if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+
|
||||
freeModule.exports = he;
|
||||
} else { // in Narwhal or RingoJS v0.7.0-
|
||||
for (var key in he) {
|
||||
has(he, key) && (freeExports[key] = he[key]);
|
||||
}
|
||||
}
|
||||
} else { // in Rhino or a web browser
|
||||
root.he = he;
|
||||
}
|
||||
|
||||
}(this));
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
.Dd April 5, 2016
|
||||
.Dt he 1
|
||||
.Sh NAME
|
||||
.Nm he
|
||||
.Nd encode/decode HTML entities just like a browser would
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl -escape Ar string
|
||||
.br
|
||||
.Op Fl -encode Ar string
|
||||
.br
|
||||
.Op Fl -encode Fl -use-named-refs Fl -everything Fl -allow-unsafe Ar string
|
||||
.br
|
||||
.Op Fl -decode Ar string
|
||||
.br
|
||||
.Op Fl -decode Fl -attribute Ar string
|
||||
.br
|
||||
.Op Fl -decode Fl -strict Ar string
|
||||
.br
|
||||
.Op Fl v | -version
|
||||
.br
|
||||
.Op Fl h | -help
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
encodes/decodes HTML entities in strings just like a browser would.
|
||||
.Sh OPTIONS
|
||||
.Bl -ohang -offset
|
||||
.It Sy "--escape"
|
||||
Take a string of text and escape it for use in text contexts in XML or HTML documents. Only the following characters are escaped: `&`, `<`, `>`, `"`, and `'`.
|
||||
.It Sy "--encode"
|
||||
Take a string of text and encode any symbols that aren't printable ASCII symbols and that can be replaced with character references. For example, it would turn `©` into `©`, but it wouldn't turn `+` into `+` since there is no point in doing so. Additionally, it replaces any remaining non-ASCII symbols with a hexadecimal escape sequence (e.g. `𝌆`). The return value of this function is always valid HTML.
|
||||
.It Sy "--encode --use-named-refs"
|
||||
Enable the use of named character references (like `©`) in the output. If compatibility with older browsers is a concern, don't use this option.
|
||||
.It Sy "--encode --everything"
|
||||
Encode every symbol in the input string, even safe printable ASCII symbols.
|
||||
.It Sy "--encode --allow-unsafe"
|
||||
Encode non-ASCII characters only. This leaves unsafe HTML/XML symbols like `&`, `<`, `>`, `"`, and `'` intact.
|
||||
.It Sy "--encode --decimal"
|
||||
Use decimal digits rather than hexadecimal digits for encoded character references, e.g. output `©` instead of `©`.
|
||||
.It Sy "--decode"
|
||||
Takes a string of HTML and decode any named and numerical character references in it using the algorithm described in the HTML spec.
|
||||
.It Sy "--decode --attribute"
|
||||
Parse the input as if it was an HTML attribute value rather than a string in an HTML text content.
|
||||
.It Sy "--decode --strict"
|
||||
Throw an error if an invalid character reference is encountered.
|
||||
.It Sy "-v, --version"
|
||||
Print he's version.
|
||||
.It Sy "-h, --help"
|
||||
Show the help screen.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
The
|
||||
.Nm he
|
||||
utility exits with one of the following values:
|
||||
.Pp
|
||||
.Bl -tag -width flag -compact
|
||||
.It Li 0
|
||||
.Nm
|
||||
did what it was instructed to do successfully; either it encoded/decoded the input and printed the result, or it printed the version or usage message.
|
||||
.It Li 1
|
||||
.Nm
|
||||
encountered an error.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
.Bl -ohang -offset
|
||||
.It Sy "he --escape '<script>alert(1)</script>'"
|
||||
Print an escaped version of the given string that is safe for use in HTML text contexts, escaping only `&`, `<`, `>`, `"`, and `'`.
|
||||
.It Sy "he --decode '©𝌆'"
|
||||
Print the decoded version of the given HTML string.
|
||||
.It Sy "echo\ '©𝌆'\ |\ he --decode"
|
||||
Print the decoded version of the HTML string that gets piped in.
|
||||
.El
|
||||
.Sh BUGS
|
||||
he's bug tracker is located at <https://github.com/mathiasbynens/he/issues>.
|
||||
.Sh AUTHOR
|
||||
Mathias Bynens <https://mathiasbynens.be/>
|
||||
.Sh WWW
|
||||
<https://mths.be/he>
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"_from": "he@1.2.0",
|
||||
"_id": "he@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"_location": "/he",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "he@1.2.0",
|
||||
"name": "he",
|
||||
"escapedName": "he",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/html-to-text",
|
||||
"/mailparser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"_shasum": "84ae65fa7eafb165fddb61566ae14baf05664f0f",
|
||||
"_spec": "he@1.2.0",
|
||||
"_where": "/data/node_modules/mailparser",
|
||||
"author": {
|
||||
"name": "Mathias Bynens",
|
||||
"url": "https://mathiasbynens.be/"
|
||||
},
|
||||
"bin": {
|
||||
"he": "bin/he"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/mathiasbynens/he/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "A robust HTML entities encoder/decoder with full Unicode support.",
|
||||
"devDependencies": {
|
||||
"codecov.io": "^0.1.6",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-cli": "^1.3.1",
|
||||
"grunt-shell": "^1.1.1",
|
||||
"grunt-template": "^0.2.3",
|
||||
"istanbul": "^0.4.2",
|
||||
"jsesc": "^1.0.0",
|
||||
"lodash": "^4.8.2",
|
||||
"qunit-extras": "^1.4.5",
|
||||
"qunitjs": "~1.11.0",
|
||||
"regenerate": "^1.2.1",
|
||||
"regexgen": "^1.3.0",
|
||||
"requirejs": "^2.1.22",
|
||||
"sort-object": "^3.0.2"
|
||||
},
|
||||
"directories": {
|
||||
"bin": "bin",
|
||||
"man": "man",
|
||||
"test": "tests"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE-MIT.txt",
|
||||
"he.js",
|
||||
"bin/",
|
||||
"man/"
|
||||
],
|
||||
"homepage": "https://mths.be/he",
|
||||
"keywords": [
|
||||
"string",
|
||||
"entities",
|
||||
"entity",
|
||||
"html",
|
||||
"encode",
|
||||
"decode",
|
||||
"unicode"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "he.js",
|
||||
"man": [
|
||||
"/data/node_modules/he/man/he.1"
|
||||
],
|
||||
"name": "he",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/mathiasbynens/he.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "grunt build",
|
||||
"test": "node tests/tests.js"
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
||||
Reference in new issue
Block a user