Closed karensg closed 8 years ago
Yes, i have also faced the issue starting from version 0.6.0
Thanks for reporting this, and sorry for the trouble! I'll take a look this morning.
On Mon, Jan 18, 2016 at 6:26 AM Subhash notifications@github.com wrote:
Yes, i have also faced the issue starting from version 0.6.0
— Reply to this email directly or view it on GitHub https://github.com/ericclemmons/grunt-angular-templates/issues/144#issuecomment-172502818 .
@karensg or @subhash85 I'm trying to track down this issue, but running what you pasted above is giving identical results between 0.5.9 and 0.6 / 1.0. Can you provide additional detail about what's different in your results between the two version, and any additional options that might effect the output? Thanks!
Yes, of course.
ngtemplates: {
dist: {
options: {
module: 'pluggdApp',
htmlmin: '<%= htmlmin.dist.options %>',
usemin: 'scripts/scripts.js'
},
cwd: '<%= yeoman.app %>',
src: 'views/{,**/}*.html',
dest: '.tmp/templateCache.js'
}
}
HTMLmin options:
options: {
collapseWhitespace: true,
conservativeCollapse: true,
collapseBooleanAttributes: true,
removeCommentsFromCDATA: true,
removeComments: true
}
HTML that fails:
<textarea class="form-control form-area" maxlength="5000" name="bio" ng-model="artist.bio" ng-required="true" placeholder="Vertel de bezoeker je verhaal en wat jouw optreden uniek maakt.
Let op: verwijzingen naar andere websites of pagina's op sociale media worden verwijderd." tabindex="5"></textarea>
@karensg can you also provide the correct result that you're seeing from 0.5.9 and indicate what 0.6.0 is doing wrong? Sorry for all the questions, but i'm having a hard time getting the two versions to produce different results. Thanks!
Thanks for looking at the issue. This is 0.6:
$templateCache.put('views/artist/steps/_1.html',
"<textarea class=\"form-control form-area\" maxlength=\"5000\" name=\"bio\" ng-model=\"artist.bio\" ng-required=\"true\" placeholder=\"Vertel de bezoeker je verhaal en wat jouw optreden uniek maakt.
" +
"\n" +
"Let op: verwijzingen naar andere websites of pagina's op sociale media worden verwijderd.\" tabindex=\"5\"></textarea>"
);
This is 0.5.9
$templateCache.put('views/artist/steps/_1.html',
"<textarea class=\"form-control form-area\" maxlength=\"5000\" name=\"bio\" ng-model=\"artist.bio\" ng-required=\"true\" placeholder=\"Vertel de bezoeker je verhaal en wat jouw optreden uniek maakt.\r" +
"\n" +
"Let op: verwijzingen naar andere websites of pagina's op sociale media worden verwijderd.\" tabindex=\"5\"></textarea>"
);
Oooh, interesting. It looks like it's the \r
that's causing the problem, we aren't handling those. I'll put together something.
@karensg Have a look at https://github.com/ericclemmons/grunt-angular-templates/pull/147 see if that fixes it for you
Yes, it fixes the problem. Thanks a lot.
Hi,
Version 0.6 and 1.0.1 have some unexpected behavior for line breaks in attributes. Try the following:
The output of the 0.5.9 and 0.6 is different. In version 0.6, the string of the first line is only closed on a new line which breaks the integration with ngAnnotate.
Btw: thanks for updating dependencies in 1.0. Very happy about it!
Karens