Skip to content

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

Merged

Conversation

yuliya-ivaniukovich
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Mar 11, 2018

Coverage Status

Coverage remained the same at 99.18% when pulling fa2a8b4 on yuliya-ivaniukovich:empty-style-fix into 29084cf on remarkablemark:master.

Copy link
Owner

@remarkablemark remarkablemark left a 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) {
Copy link
Owner

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?

Copy link
Contributor Author

@yuliya-ivaniukovich yuliya-ivaniukovich Mar 26, 2018

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

Copy link
Owner

Choose a reason for hiding this comment

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

Gotcha thanks for clarifying

@remarkablemark remarkablemark self-assigned this Mar 14, 2018
@remarkablemark remarkablemark added the bug Something isn't working label Mar 14, 2018
@yuliya-ivaniukovich
Copy link
Contributor Author

Amended comment as requested

@remarkablemark remarkablemark merged commit 6ccb639 into remarkablemark:master Mar 27, 2018
d-lazarev pushed a commit to d-lazarev/html-react-parser that referenced this pull request Apr 5, 2019
…tyle-fix

Fix case when style is empty string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants