-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex containing "/" (backslash) fails starting from v0.6 #145
Comments
Thanks for the report! I have an idea where the problem might be, we modified the way we stringify the lines and it looks like something in there is causing a problem in this case. I'll take a look at it now. |
@RonaldTreur mind taking a quick look at #146 ? |
Tested it and works like a charm! Good to go ;-) |
i'm having the same issue but in a different context. the current stringify function fails in case a user uses in its code escaped quotes. this happens for example if in your code you have something like: <input name="password" class="form-control" data-ng-model="admin_password" type="password" data-ng-attr-placeholder="{{'Enter a password for the user \'admin\'' | translate}}" required> i've already tried using: options: {
quotes: 'single'
} but obviously in this context both single and double quotes are used so switching is making other things failing. my suggestion is in the meantime to simply revert d2dc35c and then iterate on this issue until a stable solution is found. |
I took care to retest the fix in #146 on GlobaLeaks that is using grunt-angular-templates extensively but some pages are still failing. I will keep you posted with the details to be reused in the unit testing. |
@evilaliv3 What do you think about #148 ? |
going to try it now |
Hi guys,
Happy to see this project continues with a new crew. Thanks you guys and good luck! And of course a big thanks to @ericclemmons for initiating this project!
As for my issue:
I used to work with 0.5.9 and that worked great. Today I finally got around to update to v1.0.1, but unfortunately that didn't produce the same result. A regular expression contained in the HTML (ng-pattern attribute) suddenly caused the browser to throw up. I backtracked a bit and noticed this started with v0.6.
This is the regex in the source HTML file:
/^(((\+[1-9][0-9])|(00[1-9][0-9]))[0-9]{7,11})|((((01|02|03|04|05|07|08)[0-9])|(06[1-9]))[0-9]{7})$/
This is what v0.5.9 produced (inside the $templateCache.put)
/^(((\\+[1-9][0-9])|(00[1-9][0-9]))[0-9]{7,11})|((((01|02|03|04|05|07|08)[0-9])|(06[1-9]))[0-9]{7})$/
This is what v0.6.0 (and higher) produces (inside the $templateCache.put)
/^(((\+[1-9][0-9])|(00[1-9][0-9]))[0-9]{7,11})|((((01|02|03|04|05|07|08)[0-9])|(06[1-9]))[0-9]{7})$/
The only difference is the backslash character (@ position 6) is no longer being escaped properly. Which means the end result is (in the DOM):
/^(((+[1-9][0-9])|(00[1-9][0-9]))[0-9]{7,11})|((((01|02|03|04|05|07|08)[0-9])|(06[1-9]))[0-9]{7})$/
which (correctly) results in the following error:
Any idea where this went wrong? When I have more time I can try to figure it out myself, but for the moment I'm back at v0.5.9.
The text was updated successfully, but these errors were encountered: