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

[Issue] Keep empty attributes assigned pointless empty value #15

Closed
mikehayesuk opened this issue Jul 30, 2014 · 1 comment
Closed

[Issue] Keep empty attributes assigned pointless empty value #15

mikehayesuk opened this issue Jul 30, 2014 · 1 comment

Comments

@mikehayesuk
Copy link

When the "keep empty attributes" option is enabled, the compiled HTML actually grows because the attribute is given an empty string value even if it has no value before.

Example, the following:

<div translate>Test</div>

Is compiled to:

<div translate="">Test</div>

The use case that applies here is AngularJS directives, though I'm sure there are other use cases for attributes without a value. The issue was originally raised by @udayms here: https://github.com/jonathanepollack/gulp-minify-html/issues/6

Thanks

@Swaagie
Copy link
Owner

Swaagie commented Jul 30, 2014

Thx for reporting, this should not happen indeed. Might be a bit dependant on what htmlparser2 provides but I guess there will be reference to the original value (or undef if not set)

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