Skip to content

Instantly share code, notes, and snippets.

@ProZachJ
Created March 3, 2021 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ProZachJ/c082a1116e5fee751352dd74d18022ea to your computer and use it in GitHub Desktop.
Save ProZachJ/c082a1116e5fee751352dd74d18022ea to your computer and use it in GitHub Desktop.
function filter(injection, html){
var testing = injection.split('~').map(function(v) {
var json = JSON.stringify(v).replace(/<\//g, '<\\/');
return '<script>goodluck('+json+')</script>';
}).join('');
return html.replace(/INJECTION/, testing);
}
function goodluck(input){
return console.log('goodluck with ' + input + ' <3.');;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment