Skip to content

Instantly share code, notes, and snippets.

@maijou2501
Last active October 29, 2016 16:47
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 maijou2501/de19b3a1d1272c40a486 to your computer and use it in GitHub Desktop.
Save maijou2501/de19b3a1d1272c40a486 to your computer and use it in GitHub Desktop.
Add, escape of '&' and '<' and '>'
javascript:(function(){var getSelect=document.getSelection().toString().replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\r?\n/g," \n> ");var blockquote="> "+getSelect+" \n> <br><cite><a href=\""+document.location+"\">"+document.title.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')+"</a></cite>";alert(blockquote);})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment