Replace htmlentities with newer html-entities

This commit is contained in:
pyoor 2018-08-30 09:56:43 -04:00
parent 813b6b2c84
commit 4fda7284c6
2 changed files with 4 additions and 4 deletions

View File

@ -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)
}
/**

View File

@ -79,7 +79,7 @@
"webpack-cli": "^3.1.0"
},
"dependencies": {
"htmlentities": "^1.0.0",
"html-entities": "^1.2.1",
"jsesc": "^2.5.1"
}
}