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 bug when tag === false #66

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Fix bug when tag === false #66

merged 1 commit into from
Dec 14, 2018

Conversation

fstanis
Copy link
Contributor

@fstanis fstanis commented Dec 10, 2018

It seems there's an edge-case where another posthtml plugin produces (I believe valid) tree that looks like this:

{
  tag: false,
  attrs: {
    something: 'abc'
  },
  content: [
   ...
  ]
}

In this case, a placeholder element was replaced by changing tag to false, but the attrs property remained. This cases collapseBooleanAttributes to throw TypeError: node.tag.search is not a function since node.tag is a boolean and doesn't have the search property.

@maltsev maltsev merged commit 11741ee into posthtml:master Dec 14, 2018
@maltsev
Copy link
Member

maltsev commented Dec 14, 2018

Thanks for the PR, Filip!

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.

None yet

2 participants