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

make removeOptionalTags more conservative #514

Merged
merged 1 commit into from
Feb 29, 2016
Merged

make removeOptionalTags more conservative #514

merged 1 commit into from
Feb 29, 2016

Conversation

alexlamsl
Copy link
Collaborator

As discovered in #503, we should treat all HTML tags around non-standard tags as mandatory.

They might get transformed by JavaScript libraries into various locations of the final DOM tree, which may or may not break the optional tag rules.

@alexlamsl
Copy link
Collaborator Author

rebased

add more tests to clarify whitespace handling rules
@alexlamsl
Copy link
Collaborator Author

rebased again 👻

@alexlamsl
Copy link
Collaborator Author

@kangax if you would publish 1.2.1 after this, I'd be grateful (to get beaten up by a new round of bug reports... 😅)

kangax added a commit that referenced this pull request Feb 29, 2016
make removeOptionalTags more conservative
@kangax kangax merged commit b3ce75e into kangax:gh-pages Feb 29, 2016
equal(minify(input, { collapseWhitespace: true, removeOptionalTags: true }), output);

input = '<html><body></body></html> ';
output = ' ';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it's probably more theoretical than anything, but I wonder if we really care about leaving space in cases like this...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are for the benefit of keeping track of this tricky logic than of any real world importance, I agree.

Pretty sure most people can't tell an empty screen from one with a whitespace on it 👻

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

Successfully merging this pull request may close these issues.

None yet

2 participants