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

[BUGFIX] Don’t create empty style attributes #702

Merged
merged 1 commit into from
Sep 11, 2019

Conversation

JakeQZ
Copy link
Contributor

@JakeQZ JakeQZ commented Sep 11, 2019

Although parseCssRules() drops rules with empty declarations blocks, those
which contain non-whitespace but no actual parsable declarations are retained,
as the declarations themselves are parsed later – (indirectly) by
copyInlineableCssToStyleAttribute(). An additional check is now made in that
method.

(Also removed a trailing EOL whitespace in the CHANGELOG.)

Fixes #259.

Although `parseCssRules()` drops rules with empty declarations blocks, those
which contain non-whitespace but no actual parsable declarations are retained,
as the declarations themselves are parsed later – (indirectly) by
`copyInlineableCssToStyleAttribute()`.  An additional check is now made in that
method.

(Also removed a trailing EOL whitespace in the CHANGELOG.)

Fixes #259.
@JakeQZ JakeQZ added the bug label Sep 11, 2019
@JakeQZ JakeQZ added this to the 3.0.0 milestone Sep 11, 2019
@JakeQZ JakeQZ self-assigned this Sep 11, 2019
Copy link
Contributor

@oliverklee oliverklee left a comment

Choose a reason for hiding this comment

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

Looks good.

@oliverklee oliverklee merged commit 4c713b0 into master Sep 11, 2019
@oliverklee oliverklee deleted the bugfix/empty-style-attribute branch September 11, 2019 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid CSS causes empty style nodes
2 participants