mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
replaced homegrown with package
This commit is contained in:
@@ -92,6 +92,7 @@
|
||||
"dotenv": "^4.0.0",
|
||||
"ejs": "^2.5.7",
|
||||
"env-rewrite": "^1.0.2",
|
||||
"escape-html": "^1.0.3",
|
||||
"eventemitter2": "^4.1.2",
|
||||
"exports-loader": "^0.6.4",
|
||||
"express": "4.16.0",
|
||||
|
||||
+1
-18
@@ -1,21 +1,4 @@
|
||||
/**
|
||||
* escapeHTMLEntities will escape HTML entities with their unicode counterparts.
|
||||
*
|
||||
* @param {String} string the string containing potentially unsafe characters
|
||||
*/
|
||||
const escapeHTMLEntities = string =>
|
||||
string.replace(/[<>&]/g, function(c) {
|
||||
switch (c.charCodeAt(0)) {
|
||||
case 0x3c:
|
||||
return '\\u003c';
|
||||
case 0x3e:
|
||||
return '\\u003e';
|
||||
case 0x26:
|
||||
return '\\u0026';
|
||||
default:
|
||||
return c;
|
||||
}
|
||||
});
|
||||
const escapeHTMLEntities = require('escape-html');
|
||||
|
||||
/**
|
||||
* encodeJSONForHTML will encode an object to be loaded on an HTML page.
|
||||
|
||||
@@ -2862,7 +2862,7 @@ es6-promise@^4.0.5:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.1.1.tgz#8811e90915d9a0dba36274f0b242dbda78f9c92a"
|
||||
|
||||
escape-html@~1.0.3:
|
||||
escape-html@^1.0.3, escape-html@~1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user