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 issue 261: parser.tag is containing tag in non-text nodes #263

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

Conversation

jpilgrim
Copy link

This PR fixes issue #261.

According to the documentation, the parser object property "tag" reflects "The current tag being dealt with."
What is the "current tag". I assume this is the containing tag (or element) in case of non-tag nodes such as comments or text.

This PR ensures that parser.tag always is the current node.

For some node types (e.g., comments) no tag has been available before. For other node types (text and processing instructions), in some cases the following node has been set. This is fixed now.

The PR contains a test file which (dynamically) generates 60 scenarios ensuring that the current tag is actually available.

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.

1 participant