Skip to content

Fix case when style is empty string#49

Merged
remarkablemark merged 1 commit intoremarkablemark:masterfrom
yuliya-ivaniukovich:empty-style-fix
Mar 27, 2018
Merged

Fix case when style is empty string#49
remarkablemark merged 1 commit intoremarkablemark:masterfrom
yuliya-ivaniukovich:empty-style-fix

Conversation

@yuliya-ivaniukovich
Copy link
Copy Markdown
Contributor

No description provided.

@coveralls
Copy link
Copy Markdown

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
Copy Markdown
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


// convert inline style to object
if (attributes.style) {
if (attributes.style != null) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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