Skip to content

firstChild does not properly work with tag name text #120

Open
@Igor-Palaguta

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions