Skip to content

Instantly share code, notes, and snippets.

@XinyueZ
Created October 13, 2015 10:07
Show Gist options
  • Select an option

  • Save XinyueZ/dc2ff3a6c0bae2b8c9ae to your computer and use it in GitHub Desktop.

Select an option

Save XinyueZ/dc2ff3a6c0bae2b8c9ae to your computer and use it in GitHub Desktop.
Common examples of Escapes elements
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escapeMap = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#x27;',
'`': '&#x60;'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment