You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I want to cut a long HTML document into sections, following the header tags h1, h2, etc...
I'm trying to use position tracking to find the beginning and the end of the headers, but it seems only the opening tag is tracked, but the closing tag is not tracked... except for non-official header tags (ie. h1 to h6 are official HTML header tags, but my document also has h7 and h8 which are not part of the HTML specification.
Let's take a concrete example, let's say you have the following snippet:
The opening header tags have correct start/end positions for the opening tag.
But all the closing header tags (except the non-standard ones like h7 and h8) have -1 values, as if it wasn't tracked, or that there was no closing tag at all.
Shouldn't the endSourceRange() return non -1 positions?
The text was updated successfully, but these errors were encountered:
I have a use case where I want to cut a long HTML document into sections, following the header tags h1, h2, etc...
I'm trying to use position tracking to find the beginning and the end of the headers, but it seems only the opening tag is tracked, but the closing tag is not tracked... except for non-official header tags (ie. h1 to h6 are official HTML header tags, but my document also has h7 and h8 which are not part of the HTML specification.
Let's take a concrete example, let's say you have the following snippet:
I'm then setting the flag to track the position with, and selecting the headers:
When I print the element's
.sourceRange().start() / end()
and.endSourceRange().start() / end()
, I get the following output:The opening header tags have correct start/end positions for the opening tag.
But all the closing header tags (except the non-standard ones like h7 and h8) have -1 values, as if it wasn't tracked, or that there was no closing tag at all.
Shouldn't the
endSourceRange()
return non -1 positions?The text was updated successfully, but these errors were encountered: