-
-
Notifications
You must be signed in to change notification settings - Fork 136
Fix case when style is empty string #49
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 case when style is empty string #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like my comment in the other PR, do you mind amending the commit message because the conventional commit format is used when releasing and publishing the package:
fix(parser): fix case when style is empty string
@@ -46,7 +46,7 @@ function attributesToProps(attributes) { | |||
} | |||
|
|||
// convert inline style to object | |||
if (attributes.style) { | |||
if (attributes.style != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, are we not doing strict equality on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if attributes.style is undefined or null this will return false in both cases (I think I've added corresponding unit tests), inspired by lodash'es isNil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha thanks for clarifying
7e573c3
to
fa2a8b4
Compare
Amended comment as requested |
…tyle-fix Fix case when style is empty string
No description provided.