html-entities
Advanced tools
Comparing version 2.3.6 to 2.4.0
@@ -5,3 +5,3 @@ export declare type Level = 'xml' | 'html4' | 'html5' | 'all'; | ||
} | ||
export declare type EncodeMode = 'specialChars' | 'nonAscii' | 'nonAsciiPrintable' | 'extensive'; | ||
export declare type EncodeMode = 'specialChars' | 'nonAscii' | 'nonAsciiPrintable' | 'nonAsciiPrintableOnly' | 'extensive'; | ||
export interface EncodeOptions extends CommonOptions { | ||
@@ -8,0 +8,0 @@ mode?: EncodeMode; |
@@ -20,5 +20,6 @@ "use strict"; | ||
specialChars: /[<>'"&]/g, | ||
nonAscii: /(?:[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, | ||
nonAsciiPrintable: /(?:[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, | ||
extensive: /(?:[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g | ||
nonAscii: /[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g, | ||
nonAsciiPrintable: /[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g, | ||
nonAsciiPrintableOnly: /[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g, | ||
extensive: /[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g | ||
}; | ||
@@ -25,0 +26,0 @@ var defaultEncodeOptions = { |
{ | ||
"name": "html-entities", | ||
"version": "2.3.6", | ||
"version": "2.4.0", | ||
"description": "Fastest HTML entities encode/decode library.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -20,3 +20,3 @@ html-entities | ||
Encodes text replacing HTML special characters (`<>&"'`) plus other character ranges depending on `mode` option value. | ||
Encodes text replacing HTML special characters (`<>&"'`) and/or other character ranges depending on `mode` option value. | ||
@@ -34,2 +34,5 @@ ```js | ||
// -> '< ©' | ||
encode('< > " \' & ©', {mode: 'nonAsciiPrintableOnly', level: 'xml'}); | ||
// -> '< > " \' & ©' | ||
``` | ||
@@ -49,4 +52,5 @@ | ||
* `specialChars` encodes only HTML special characters (default). | ||
* `nonAscii` encodes HTML special characters and everything outside of the [ASCII character range](https://en.wikipedia.org/wiki/ASCII). | ||
* `nonAscii` encodes HTML special characters and everything outside the [ASCII character range](https://en.wikipedia.org/wiki/ASCII). | ||
* `nonAsciiPrintable` encodes HTML special characters and everything outiside of the [ASCII printable characters](https://en.wikipedia.org/wiki/ASCII#Printable_characters). | ||
* `nonAsciiPrintableOnly` everything outiside of the [ASCII printable characters](https://en.wikipedia.org/wiki/ASCII#Printable_characters) keeping HTML special characters intact. | ||
* `extensive` encodes all non-printable characters, non-ASCII characters and all characters with named references. | ||
@@ -53,0 +57,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96537
219
218