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

Fix: Validate style attributes on the RHS #222

Merged
merged 1 commit into from
Oct 26, 2018

Conversation

sunesimonsen
Copy link
Member

We currently ignore empty styles in RHS which is quite surprising. This PR
fixes it by validating the RHS styles.

We currently ignore empty styles in RHS which is quite surprising. This commit
fixes it by validating the RHS styles.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 832

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 91.537%

Totals Coverage Status
Change from base Build 829: 0.08%
Covered Lines: 529
Relevant Lines: 559

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 832

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 91.537%

Totals Coverage Status
Change from base Build 829: 0.08%
Covered Lines: 529
Relevant Lines: 559

💛 - Coveralls

Copy link
Member

@papandreou papandreou 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! It highlights that it would be good to introduce a proper CSS parser.

@sunesimonsen
Copy link
Member Author

What are you implying there is something wrong with our regex machine 😜

@papandreou
Copy link
Member

Not for a second :)

@alexjeffburke
Copy link
Member

This looks really good. I think it's the right balance of not being overly prescriptive but still protecting the user at the point of checks.

Just one thing I wanted to double check, but in the case of an empty string style on the RHS I guess anything still satisfies? The only reason I ask is I believe that is the behaviour of "class" and keeping consistency would be a win.

@sunesimonsen
Copy link
Member Author

Just one thing I wanted to double check, but in the case of an empty string style on the RHS I guess anything still satisfies? The only reason I ask is I believe that is the behaviour of "class" and keeping consistency would be a win.

That would pass as it would translate to the empty object on the RHS.

@sunesimonsen sunesimonsen merged commit b96fa32 into master Oct 26, 2018
@sunesimonsen sunesimonsen deleted the ssimonsen/fail-on-invalid-styles-in-lhs branch October 26, 2018 18:00
@sunesimonsen
Copy link
Member Author

Released as unexpected-dom@4.8.0

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.

5 participants