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

Some text nodes not present in tree after parsing - seems to be mixed content with formatted xml #63

Open
max-carroll opened this issue Apr 27, 2021 · 3 comments

Comments

@max-carroll
Copy link

max-carroll commented Apr 27, 2021

func Test_MyTest(t *testing.T) {
	assert := assert.New(t)
	inputHtml := `
	<a>
	  <b>hello</b>
		my friend
  </a>`

	topNode, _ := xmlquery.Parse(strings.NewReader(inputHtml))

      //  `my friend` should be a sibling with <b> or a child of <a> but it is neither and unobtainable from the tree structure
}
@max-carroll
Copy link
Author

One thing thats notable is if we remove all the whitespace, the my friend node is within the tree structure

@zhengchun
Copy link
Contributor

Hello, which version are you using? I test on my machine with the latest version, the output is not problem.

output:
<?xml?><a><b>hello</b>my friend</a>

@galtm
Copy link

galtm commented Sep 22, 2021

@max-carroll : Now that v1.3.7 has been released with the fix in PR #62 , I wonder if that fixes this issue.

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

No branches or pull requests

3 participants