Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Last active February 16, 2018 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WebReflection/646de480b2bc140aef22d5520bcfc054 to your computer and use it in GitHub Desktop.
Save WebReflection/646de480b2bc140aef22d5520bcfc054 to your computer and use it in GitHub Desktop.
if(JSON.stringify('\u2028').length<4)JSON.stringify=function(s,r,f){return function() {return s.apply(null,arguments).replace(r,f)}}(JSON.stringify,/\u2028|\u2029/g,function(c){return'\u2028'==c?'\\u2028':'\\u2029'});
@WebReflection
Copy link
Author

Above code patches the infamous \u2028 and \u2029 bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment