Skip to content

Commit 81a8050

Browse files
authored
Merge pull request #29 from anonyein/origin
Origin
2 parents d4f31e3 + 6d24910 commit 81a8050

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
<plugin>
170170
<groupId>org.apache.maven.plugins</groupId>
171171
<artifactId>maven-jar-plugin</artifactId>
172-
<version>3.4.2</version>
172+
<version>3.5.0</version>
173173
<configuration>
174174
<archive>
175175
<manifest>

src/main/java/org/jsoup/parser/StreamParser.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ Iterator interface. Elements returned will be complete with all their children,
4747
stream consumers will throw an {@link java.io.UncheckedIOException} if the underlying Reader errors during read.</p>
4848
<p>For examples, see the jsoup
4949
<a href="https://jsoup.org/cookbook/input/streamparser-dom-sax">StreamParser cookbook.</a></p>
50-
@since 1.18.1
51-
*/
50+
<p>
51+
Selectors that depend on knowing all siblings (e.g. {@code :last-child}, {@code :last-of-type}, {@code :nth-last-child},
52+
{@code :only-child} and their negations) cannot be correctly evaluated while streaming, because the parser does not know
53+
if a later sibling will appear. For those cases, run {@link #complete()} first to finish the parse (which is effectively
54+
the same as using {@code Jsoup.parse(...)} unless you have already removed nodes during streaming).
55+
</p>
56+
@since 1.18.1 */
5257
public class StreamParser implements Closeable {
5358
final private Parser parser;
5459
final private TreeBuilder treeBuilder;

0 commit comments

Comments
 (0)