Some text nodes not present in tree after parsing - seems to be mixed content with formatted xml
max-carroll opened this issue · comments
Max Carroll commented
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 commented
One thing thats notable is if we remove all the whitespace, the my friend node is within the tree structure
zhengchun commented
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>
Amanda Galtman commented
@max-carroll : Now that v1.3.7 has been released with the fix in PR #62 , I wonder if that fixes this issue.