scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.52k stars 345 forks source link

getAllElements doesn't return in the good order of the original html #232

Open AlexandreAad opened 1 year ago

AlexandreAad commented 1 year ago

Hello,

I'm experiencing a problem while calling the getAllElements function. It seems the tags are not always in the good order.

For example,

if I have a

<div>
  <p>Hello</p>
  <p>Hi</p>
Bye
</div>

The getAllElements function will return in this order : "Bye, Hello, Hi". So when we try to build the html in a textView on tvOS, we don't have the elements in the good order unfortunately.

Is it a normal behavior or a bug?

Thanks in advance!