App-Netdisco
view release on metacpan or search on metacpan
share/public/javascripts/he.js view on Meta::CPAN
return '&' + encodeMap[string] + ';';
});
} else {
// Encode `<>"'&` using hexadecimal escapes, now that theyâre not handled
// using named character references.
string = string.replace(regexEscape, hexEscape);
}
return string
// Encode astral symbols.
.replace(regexAstralSymbols, function($0) {
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
var high = $0.charCodeAt(0);
var low = $0.charCodeAt(1);
var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
return '&#x' + codePoint.toString(16).toUpperCase() + ';';
})
// Encode any remaining BMP symbols that are not printable ASCII symbols
// using a hexadecimal escape.
.replace(regexBmpWhitelist, hexEscape);
};
// Expose default options (so they can be overridden globally).
( run in 0.616 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )