Sha256: 15fbd41c7058fd9f797203f8d35da9fb2f7ee9c5df981b7c16d1996aea6ece4e

Contents?: true

Size: 390 Bytes

Versions: 19

Compression:

Stored size: 390 Bytes

Contents

var makeString = require('./helper/makeString');
var escapeChars = require('./helper/escapeChars');

var regexString = '[';
for(var key in escapeChars) {
  regexString += key;
}
regexString += ']';

var regex = new RegExp( regexString, 'g');

module.exports = function escapeHTML(str) {

  return makeString(str).replace(regex, function(m) {
    return '&' + escapeChars[m] + ';';
  });
};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 node_modules/underscore.string/escapeHTML.js
ela-4.1.5 node_modules/underscore.string/escapeHTML.js
ela-4.1.4 node_modules/underscore.string/escapeHTML.js
ela-4.1.3 node_modules/underscore.string/escapeHTML.js
ela-4.1.2 node_modules/underscore.string/escapeHTML.js
ela-4.1.1 node_modules/underscore.string/escapeHTML.js
ela-4.1.0 node_modules/underscore.string/escapeHTML.js
ela-4.0.0 node_modules/underscore.string/escapeHTML.js
ela-3.4.3 node_modules/underscore.string/escapeHTML.js
ela-3.4.2 node_modules/underscore.string/escapeHTML.js
ela-3.4.0 node_modules/underscore.string/escapeHTML.js
ela-3.3.1 node_modules/underscore.string/escapeHTML.js
ela-3.3.0 node_modules/underscore.string/escapeHTML.js
ela-3.2.0 node_modules/underscore.string/escapeHTML.js
ela-3.1.1 node_modules/underscore.string/escapeHTML.js
ela-3.1.0 node_modules/underscore.string/escapeHTML.js
ela-3.0.0 node_modules/underscore.string/escapeHTML.js
ela-2.0.0 node_modules/underscore.string/escapeHTML.js
ela-1.1.0 node_modules/underscore.string/escapeHTML.js