Skip to content

Instantly share code, notes, and snippets.

@laczoka
Created July 21, 2011 14:31
Show Gist options
  • Save laczoka/1097307 to your computer and use it in GitHub Desktop.
Save laczoka/1097307 to your computer and use it in GitHub Desktop.
String.replace
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