Skip to content

Commit 908224e

Browse files
committed
Merge pull request #255 from smoke/master
Fix problem with multi-line comments breaking compileAngularTemplates step due to invalid JS generated for the template
2 parents 2792b98 + a776386 commit 908224e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.docs/angular-meteor/client/views/someshit.ng.html

Whitespace-only changes.

plugin/handler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Plugin.registerSourceHandler('ng.html', {
1515
// Ticket here: https://github.com/Urigo/angular-meteor/issues/169
1616
// A standardized solution to this problem might be on its way, see this ticket:
1717
// https://github.com/meteor/windows-preview/issues/47
18-
'$templateCache.put(\'' + compileStep.inputPath.replace(/\\/g, "/") + '\', \'' +
19-
minify(contents.replace(/'/g, "\\'"), {
18+
'$templateCache.put(' + JSON.stringify(compileStep.inputPath.replace(/\\/g, "/")) + ', ' +
19+
JSON.stringify(minify(contents, {
2020
collapseWhitespace : true,
2121
conservativeCollapse : true,
2222
minifyJS : true,
2323
minifyCSS : true,
2424
processScripts : ['text/ng-template']
25-
}) + '\');' +
25+
})) + ');' +
2626
'}]);';
2727

2828
compileStep.addJavaScript({

0 commit comments

Comments
 (0)