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