Closed satodavan closed 7 years ago
I have regex https://regex101.com/r/esi04u/1 , but gulp-replace doesn't see capturing group in regex
.pipe(replace(/\<i role="img" class="icon-([^\"]+).*?\<\/i>/g, '<svg class="icon icon-$1" role="img"><use xlink:href="img/sprite.svg#$1"/></svg>'))
I have wrong result after this. For example tag <i role="img" class="icon-fav-in"></i> replaced with <svg class="icon icon-" role="img"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#"></use></svg>
<i role="img" class="icon-fav-in"></i>
<svg class="icon icon-" role="img"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#"></use></svg>
Sorry, It been conflict with gulp-changed-in-place. gulp-replace works fine
I have regex https://regex101.com/r/esi04u/1 , but gulp-replace doesn't see capturing group in regex
.pipe(replace(/\<i role="img" class="icon-([^\"]+).*?\<\/i>/g, '<svg class="icon icon-$1" role="img"><use xlink:href="img/sprite.svg#$1"/></svg>'))
I have wrong result after this. For example tag
<i role="img" class="icon-fav-in"></i>
replaced with<svg class="icon icon-" role="img"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#"></use></svg>