dougmoscrop / angularjs-templates-brunch

Compile templates in to an AngularJS module as a Brunch plugin
MIT License
5 stars 8 forks source link

String escaping fails in certain exotic scenarios #3

Closed wiltzius closed 9 years ago

wiltzius commented 9 years ago

The regex that escapes the HTML angular template doesn't account for all scenarios -- in particular, when there's already a backslash-escaped single quote (\') in the HTML template (in my case, present in an ng-click handler).

Since this is one of those fiddly things that's difficult to get right, I find it easier to use a library. I have a fork where I swapped the escape code for js-string-escape which addresses the issue. It's here:

https://github.com/wiltzius/angularjs-templates-brunch

I've also merged the changes from https://github.com/pavanpaik/angularjs-templates-brunch which add a base configuration option.

Are you interested in a pull request?

dougmoscrop commented 9 years ago

For sure!

wiltzius commented 9 years ago

Here you go:

https://github.com/dougmoscrop/angularjs-templates-brunch/pull/4

Let me know your thoughts.

dougmoscrop commented 9 years ago

Fixed in v1.0.0 via #4