From 4fda7284c6f8eb4d40d7a7adbf5e42097346a696 Mon Sep 17 00:00:00 2001 From: pyoor Date: Thu, 30 Aug 2018 09:56:43 -0400 Subject: [PATCH] Replace htmlentities with newer html-entities --- lib/utils/common.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils/common.js b/lib/utils/common.js index 3b5f3a5..3e26da8 100644 --- a/lib/utils/common.js +++ b/lib/utils/common.js @@ -1,7 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -const htmlentities = require('htmlentities') +const entities = new (require('html-entities').XmlEntities)() const jsesc = require('jsesc') const utils = require('../utils') @@ -79,7 +79,7 @@ class common extends utils { * @returns {string} */ static htmlEscape (str) { - return htmlentities.encode(str) + return entities.encode(str) } /** @@ -88,7 +88,7 @@ class common extends utils { * @returns {string} */ static htmlUnescape (str) { - return htmlentities.decode(str) + return entities.decode(str) } /** diff --git a/package.json b/package.json index 1258fbd..c4e4b6d 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "webpack-cli": "^3.1.0" }, "dependencies": { - "htmlentities": "^1.0.0", + "html-entities": "^1.2.1", "jsesc": "^2.5.1" } }