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

bugfix: Issue #34 #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

bugfix: Issue #34 #35

wants to merge 1 commit into from

Conversation

Cheng007
Copy link

TypeError: Cannot read properties of null (reading 'isSelfCloseTag')

Fix and test

@IntusFacultas
Copy link

Any chance we can bump this? Ran into the exact same issue, would love to be able to update.

@bellydrum
Copy link

Would love to see this acknowledged by the repo owner

return false;
}
const isCloseTag = closeTagExp.test(tag);
const [, nodeName] = tag.match(nodeNameExp) || [];
const isElementClosedByTag = isCloseTag && element.nodeName === nodeName;

return isElementClosedByTag || element.isSelfCloseTag || element.nodeType === NodeType.text;
// condition is used for reducing the complexity
const condition = [
Copy link

@bellydrum bellydrum Nov 25, 2024

Choose a reason for hiding this comment

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

Not to be a golfer but we might as well condense it further

return [
    isElementClosedByTag,
    element.isSelfCloseTag,
    element.nodeType === NodeType.text,
].some(Boolean)

However, removing this change entirely might make your PR more likely to be accepted.

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.

3 participants