Created
July 21, 2011 14:31
-
-
Save laczoka/1097307 to your computer and use it in GitHub Desktop.
String.replace
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 markMicrodata(str) { | |
var re = new RegExp('(itemprop="[^"]+")'); | |
alert("!"); | |
var marked = str.replace(re, "{{$1}}"); | |
return marked; | |
} | |
// if you place the alert after str.replace it doesn't show up, and the extension silently fails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment