Created
June 30, 2014 08:07
-
-
Save hamsterbacke23/8b60f0023817a48062a1 to your computer and use it in GitHub Desktop.
grunt regex replace intern links
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
'regex-replace' : { | |
htmlsnapshots: { | |
src: ['build/**/*.html'], | |
actions: [ | |
{ | |
name: 'changelinks', | |
search: '<\s*a(.*?)href\s*=\s*(?:"|\')(?:\/)(.*?)(?:"|\')[^>]*>(.*?)<\s*?\/\s*?a\s*?>', // jshint ignore:line | |
replace: '<a $1 href="/build/$2">$3</a>', | |
flags: 'gi' | |
} | |
] | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment