Created
January 22, 2010 18:28
-
-
Save visnup/284005 to your computer and use it in GitHub Desktop.
bookmarklet function to change people's "your" into "you're"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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