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

improve whitespace handling in type attributes #521

Merged
merged 3 commits into from
Mar 3, 2016
Merged

improve whitespace handling in type attributes #521

merged 3 commits into from
Mar 3, 2016

Conversation

alexlamsl
Copy link
Collaborator

<script type="text/javascript ; charset=utf-8"> was not recognised as executable script before - this PR fixes that.

@@ -851,6 +851,9 @@
else if (attrValue && options.customAttrCollapse && options.customAttrCollapse.test(attrName)) {
attrValue = attrValue.replace(/\n+|\r+|\s{2,}/g, '');
}
else if (tag === 'script' && attrName === 'type') {
attrValue = attrValue.split(/;/g).map(trimWhitespace).join(';');
Copy link
Owner

Choose a reason for hiding this comment

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

Or just attrValue.split(/\s*;\s*/g), right? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess you mean trimWhitespace(attrValue.split(/\s*;\s*/g)), but okay 😛

alexlamsl added a commit that referenced this pull request Mar 3, 2016
improve whitespace handling in type attributes
@alexlamsl alexlamsl merged commit 4c6a96f into kangax:gh-pages Mar 3, 2016
@alexlamsl alexlamsl mentioned this pull request Mar 8, 2016
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