Skip to content

Instantly share code, notes, and snippets.

View trevorgk's full-sized avatar

Trevor Kilvington trevorgk

View GitHub Profile
// HTML Escape helper utility
var util = (function () {
// Thanks to Andrea Giammarchi
var
reEscape = /[&<>'"]/g,
reUnescape = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g,
oEscape = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',