Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed bug where backslash (\) would not be escaped in output #9

Merged
merged 1 commit into from

2 participants

@dallonf

This can affect properties like ng-pattern.

@ericclemmons

Sorry about the delay in merging this. I was out of town.

Thanks for your contribution, @dallonf!

@ericclemmons ericclemmons merged commit 705bad1 into ericclemmons:master

1 check passed

Details default The Travis build passed
@ericclemmons

@dallonf Released v0.2.2 with your fix: 10d44af

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
2  tasks/lib/compiler.js
@@ -16,7 +16,7 @@ module.exports.init = function(grunt) {
grunt.util.async.concatSeries(files, function(file, next) {
var id = path.relative(base, file).replace( /\\/g, '/');
var template = '\n $templateCache.put("<%= id %>",\n "<%= content %>"\n );\n';
- var cleaned = grunt.file.read(file).replace(/"/g, '\\"').replace(/\r?\n/g, '" +\n "');
+ var cleaned = grunt.file.read(file).replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\r?\n/g, '" +\n "');
var options = {
data: {
id: id,
View
2  test/expected/simple.js
@@ -1,7 +1,7 @@
angular.module("simple.templates", []).run(["$templateCache", function($templateCache) {
$templateCache.put("simple.html",
- "Howdy there! Your name is \"{{ name }}\"." +
+ "Howdy there! \\ Your name is \"{{ name }}\"." +
""
);
View
2  test/fixtures/simple.html
@@ -1 +1 @@
-Howdy there! Your name is "{{ name }}".
+Howdy there! \ Your name is "{{ name }}".
Something went wrong with that request. Please try again.