allenhwkim/angular-template

Global prefix replace is too broad, breaks html

diondavidson opened this issue · 1 comments

I had an image "getting-started.gif" and my prefix is "ng". The regexp replace changed my image path to "gettiht-started.gif" which broke the image. I suggest adding a word boundary to the regexp in index.js:
if (options.prefix) {
html = html.replace(new RegExp("\\b"+options.prefix+"-",'g'), "ht-");
}

FDIM commented

Thanks for reporting the issue, I've just pushed an update that should resolve this. No more global replace :)