Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments split Text into multiple Nodes #546

@jwindgassen

Description

@jwindgassen

If you parse the following XML Node:

<node>
    Lorem ipsum dolor sit amet,
    consetetur sadipscing elitr, <!-- Some Comment -->
    sed diam nonumy eirmod tempor invidunt <!-- ut labore et dolore magna aliquyam erat-->,
    sed diam voluptua.
</node>

you will receive a node with 3 children, that contain Lorem ipsum dolor sit amet,\nconsetetur sadipscing elitr,, sed diam nonumy eirmod tempor invidunt and ,\nsed diam voluptua., respectively.

If you enable parse_comments, the root will correctly contain 5 nodes, where the 2 comments are between the 3 text nodes.
But if you disable comments, however, the text will still be split into the 3 pieces, whereas one would probably expect them to be parsed into one single node.

I don't know if that is intended behavior, but IMHO it would be better to be parsed into a single node.

~Jonathan

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions