How to use the escapeHTML function from underscore.string
Find comprehensive JavaScript underscore.string.escapeHTML code examples handpicked from public code repositorys.
GitHub: artsy/force
12 13 14 15 16 17 18 19 20 21
res.locals.csrfToken = typeof req.csrfToken === "function" ? req.csrfToken() : undefined res.locals.sd.CSRF_TOKEN = res.locals.csrfToken } if (res.locals.sd != null) { res.locals.error = escapeHTML(req.query.error) res.locals.sd.ERROR = res.locals.error } if (res.locals.sd != null) { res.locals.ap = pick(
145
533
65
GitHub: PastVu/pastvu
337 338 339 340 341 342 343 344 345 346
const host = config.client.host; const reversedEscapeChars = { '<': 'lt', '>': 'gt', '"': 'quot', '&': 'amp', "'": '#39' }; const trailingChars = '\\s).,;>'; function escape(txt) { //Паттерн из _s.escapeHTML(result); исключая амперсант return txt.replace(/[<>"']/g, m => `&${reversedEscapeChars[m]};`); } return function (txt) {
14
70
0
+ 13 other calls in file
GitHub: artsy/artsy-passport
11 12 13 14 15 16 17 18 19 20
if (res.locals.sd != null) { res.locals.csrfToken = typeof req.csrfToken === 'function' ? req.csrfToken() : undefined; res.locals.sd.CSRF_TOKEN = res.locals.csrfToken; } if (res.locals.sd != null) { res.locals.error = escapeHTML(req.query.error); res.locals.sd.ERROR = res.locals.error; } if (res.locals.sd != null) { res.locals.ap = pick(
18
10
55
33 34 35 36 37 38 39 40 41 42 43 44
exports.clean = function(value, options, callback){ callback(null, str.clean(String(value))); }; exports.escapeHTML = function(value, options, callback){ callback(null, str.escapeHTML(String(value))); }; exports.unescapeHTML = function(value, options, callback){ callback(null, str.unescapeHTML(String(value)));
2
2
0
+ 2 other calls in file
197 198 199 200 201 202 203 204 205 206 207 208
function handleSocket(user, message) { var data = JSON.parse(message); data.id = user.id; data.user = user.un; data.type = s.escapeHTML(data.type); data.message = s.escapeHTML(data.message); data.mid = (Math.random() + 1).toString(36).substr(2, 5); switch(data.type) {
1
1
0
GitHub: Kiubi/alpha
28 29 30 31 32 33 34 35 36 37
}, rawurlencode: function(value) { return encodeURIComponent(value); }, htmlentities: function(value, args) { return _string.escapeHTML(value); }, escapejs: function(value) { return _string.quote(value); },
0
1
0
+ 2 other calls in file
GitHub: DevAshleyD/node-chat
193 194 195 196 197 198 199 200 201 202 203 204
function handleSocket(user, message) { var data = JSON.parse(message) data.id = user.id data.user = user.un data.type = s.escapeHTML(data.type) data.message = s.escapeHTML(data.message) data.mid = (Math.random() + 1).toString(36).substr(2, 5) switch (data.type) {
0
0
0
+ 7 other calls in file
underscore.string.slugify is the most popular function in underscore.string (323 examples)