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

Line breaks in attributes #144

Closed
karensg opened this issue Jan 18, 2016 · 9 comments
Closed

Line breaks in attributes #144

karensg opened this issue Jan 18, 2016 · 9 comments

Comments

@karensg
Copy link

karensg commented Jan 18, 2016

Hi,

Version 0.6 and 1.0.1 have some unexpected behavior for line breaks in attributes.
Try the following:

<textarea placeholder="Line1
Line2"></textarea>

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

@subhash85
Copy link

Yes, i have also faced the issue starting from version 0.6.0

@underscorebrody
Copy link
Collaborator

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
#144 (comment)
.

@underscorebrody
Copy link
Collaborator

@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!

@karensg
Copy link
Author

karensg commented Jan 18, 2016

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>

@underscorebrody
Copy link
Collaborator

@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!

@karensg
Copy link
Author

karensg commented Jan 18, 2016

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>"
  );

@underscorebrody
Copy link
Collaborator

Oooh, interesting. It looks like it's the \r that's causing the problem, we aren't handling those. I'll put together something.

@underscorebrody
Copy link
Collaborator

@karensg Have a look at #147 see if that fixes it for you

@karensg
Copy link
Author

karensg commented Jan 19, 2016

Yes, it fixes the problem. Thanks a lot.

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

No branches or pull requests

3 participants