Skip to content
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

The backslash character is not escaped when using html2js (angular) #583

Closed
lgalfaso opened this issue Jun 18, 2013 · 6 comments
Closed

Comments

@lgalfaso
Copy link

The backslash character "" is not escaped when using the html2js preprocessor for angular

The change is very simple, just changing lib/preprocessors/Html2js.js from

var escapeContent = function(content) {
  return content.replace(/'/g, '\\\'').replace(/\n/g, '\\n\' +\n    \'');
};

to

var escapeContent = function(content) {
  return content.replace(/\\/g, '\\\\').replace(/'/g, '\\\'').replace(/\n/g, '\\n\' +\n    \'');
};

I was not able to make the project karma-ng-html2js-preprocessor so posting the issue here so it gets some visibility

@vojtajina
Copy link
Contributor

@lgalfaso would you mind sending a pull request to https://github.com/karma-runner/karma-ng-html2js-preprocessor

That would be awesome. If you include a test case for this, that would be even more awesome, you would certainly become super famous and all girls would want you, etc...

@lgalfaso
Copy link
Author

Done.
BTW, things would be a lot easier if karma-ng-html2js-preprocessor was published

@Grummle
Copy link
Contributor

Grummle commented Jun 28, 2013

Is this still an active issue or is it dead because its fixed in the newer release?

@lgalfaso
Copy link
Author

If there are plans for a 0.8.7 release, I can create a PR for it. @vojtajina ?

@vojtajina
Copy link
Contributor

@lgalfaso thanks, I saw your PR and commented.

I hope to get the canary into stable release soon, I think I'm only missing updating the docs. But it's still gonna be faster to push another patch release of 0.8._, so _if you wanna send a PR for the 0.8.* (current stable) branch as well that's great*. (btw. add Closes #583 into the commit msg body)

lgalfaso added a commit to lgalfaso/karma that referenced this issue Jun 30, 2013
Fix the test that escapes the backslash

Closes karma-runner#583
lgalfaso added a commit to lgalfaso/karma that referenced this issue Jun 30, 2013
At the html2js preprocessor escape the backslash character when this is
present in a template

Closes karma-runner#583
lgalfaso added a commit to lgalfaso/karma that referenced this issue Jun 30, 2013
At the html2js preprocessor escape the backslash character when this is
present in a template

Closes karma-runner#583
@vojtajina
Copy link
Contributor

I believe this has been fixed by #612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants