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

No error reported when HTML element contains HTML comment. Freeze. #512

Closed
rcollette opened this issue Feb 26, 2016 · 2 comments
Closed

Comments

@rcollette
Copy link

Normally I get an error if we have invalid HTML but in this case, our build task was freezing with no messaging.

Our task is

gulp.task('templates', function () {
    return gulp.src(config.templates)
      .pipe(htmlmin({
        removeComments: true,
        removeCommentsFromCDATA: true,
        removeCDATASectionsFromCDATA: true,
        collapseWhitespace: true,
        removeTagWhitespace: true,
        removeScriptTypeAttributes: true,
        removeStyleLinkTypeAttributes: true
      }))
      .pipe(templateCache('templates.js', {
        module: 'app.templates'
      }))
      .pipe(gulp.dest(config.templatesDir));
  });

The offending HTML was

    <input class="form-control" type="text" style="" id="{{vm.formInputName}}" name="{{vm.formInputName}}"
           <!--FIXME hardcoded placeholder - dates may not be used for service required fields yet. -->
           placeholder="YYYY-MM-DD"
           date-range-picker
           data-ng-model="vm.value"
           data-ng-model-options="{ debounce: 1000 }"
           data-ng-pattern="vm.options.format"
           data-options="vm.datepickerOptions">

Note the HTML comment that was accidentally placed within the input element.

Related to
jonschlinkert/gulp-htmlmin#42

@alexlamsl
Copy link
Collaborator

Just tested locally - #507 beats you to it 😜

But thanks for the test case though - I'll add that to #510 as well 😉

@alexlamsl
Copy link
Collaborator

For the record, the process doesn't freeze indefinitely - it gives a parser error after a few hours.

Not that this is acceptable performance or anything.

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

2 participants