Skip to content

Instantly share code, notes, and snippets.

@barisusakli
Created November 21, 2014 04:33
Show Gist options
  • Save barisusakli/64fb0dc37d70ced72775 to your computer and use it in GitHub Desktop.
Save barisusakli/64fb0dc37d70ced72775 to your computer and use it in GitHub Desktop.
var matches = postData.content.match(/!\[.*?]\(.*?\)/g);
console.log('matches', matches);
if (matches && matches.length) {
matches.forEach(function(image) {
if (image.indexOf('](http://') === -1 && image.indexOf('](https://') === -1 && image.indexOf('](/') === -1) {
console.log('not ALOUD', image);
postData.content = postData.content.replace(image, '');
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment