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

firstChild does not properly work with tag name text #120

Open
Igor-Palaguta opened this issue Jul 19, 2022 · 1 comment
Open

firstChild does not properly work with tag name text #120

Igor-Palaguta opened this issue Jul 19, 2022 · 1 comment

Comments

@Igor-Palaguta
Copy link

Igor-Palaguta commented Jul 19, 2022

Description:

  • Expected behaviour:
    element.firstChild(tag: "text") return first text node instead of element node with tag name "text"

  • Actual behaviour: returns element not text node

Environment

  • Package Manager:
    CocoaPods, version: 1.11.2

  • Fuzi version: 3.1.3

  • Xcode version: 13.4

How to reproduce:

<parent>
   <text>Some text</text>
</parent>

parent.firstChild(tag: "text")?.stringValue == " \n" instead of parent.firstChild(tag: "text")?.stringValue == "Some text"
parent.firstChild(tag: "text")?.type == .Text instead of parent.firstChild(tag: "text")?.type == .Element

parent.children(tag: "text") finds proper nodes as it checks also element type

@Igor-Palaguta Igor-Palaguta changed the title firstChild does not properly works with tag name text firstChild does not properly work with tag name text Jul 19, 2022
@Igor-Palaguta
Copy link
Author

@cezheng please have a look at #121

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

1 participant