Imagine this html:
<h1>Heading Number one</h1>
foo bar is bla bar....
<table>...</table>
<h1>Heading Number two</h1>
other bar is strange bar ...
...
I want to show the parts one after the other.
This means I need to select the <h1>...</h1>
until the next <h1>
.
In above example I want to get a list of html snippets:
First list item:
<h1>Heading Number one</h1>
foo bar is bla bar....
<table>...</table>
Second list item:
<h1>Heading Number two</h1>
other bar is strange bar ...
...
How to select <h1>
and everything up to the next <h1>
?
Just using nextUntil() does not help, since the text is not in a tag.
Maybe putting all text in a tag, and then call nextUntil() or a different solution....