Skip to content

Instantly share code, notes, and snippets.

@visnup
Created January 22, 2010 18:28
Show Gist options
  • Save visnup/284005 to your computer and use it in GitHub Desktop.
Save visnup/284005 to your computer and use it in GitHub Desktop.
bookmarklet function to change people's "your" into "you're"
(function your(node) {
if (node.nodeType == 3) { // text-node
node.nodeValue = node.nodeValue.replace(/\b(you)(r)\b/ig, "$1'$2e");
} else {
var c = node.childNodes;
for (var i = 0; i < c.length; i++)
your(c[i]);
}
})(document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment