escape-attribute.js
320 Bytes
/**
* Escapes characters that can not be in an XML attribute.
*/
function escapeAttribute(value) {
return value.replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
}
/**
* @api private
*/
module.exports = {
escapeAttribute: escapeAttribute
};