|
1 | 1 | # jsoup Changelog
|
2 | 2 |
|
3 |
| -## 1.19.1 (PENDING) |
| 3 | +## 1.19.1 (2025-03-04) |
4 | 4 |
|
5 | 5 | ### Changes
|
6 | 6 |
|
7 |
| -* Added support for **http/2** requests in `Jsoup.connect()`, when running on Java 11+. In this version, this is not |
8 |
| - enabled by default: use `System.setProperty("jsoup.useHttpClient", "true");` to enable. If you are repackaging the |
9 |
| - jsoup jar in your deployment (i.e. creating a shaded- or a fat-jar), make sure to specify that as a Multi-Release |
10 |
| - JAR. If the `HttpClient` impl is not available in your JRE, requests will continue to be made via |
11 |
| - `HttpURLConnection` (in `http/1.1` mode). [2257](https://github.com/jhy/jsoup/pull/2257) |
| 7 | +* Added support for **http/2** requests in `Jsoup.connect()`, when running on Java 11+, via the Java HttpClient |
| 8 | + implementation. [#2257](https://github.com/jhy/jsoup/pull/2257). |
| 9 | + * In this version of jsoup, the default is to make requests via the HttpUrlConnection implementation: use |
| 10 | + **`System.setProperty("jsoup.useHttpClient", "true");`** to enable making requests via the HttpClient instead , |
| 11 | + which will enable http/2 support, if available. This will become the default in a later version of jsoup, so now is |
| 12 | + a good time to validate it. |
| 13 | + * If you are repackaging the jsoup jar in your deployment (i.e. creating a shaded- or a fat-jar), make sure to specify |
| 14 | + that as a Multi-Release |
| 15 | + JAR. |
| 16 | + * If the `HttpClient` impl is not available in your JRE, requests will continue to be made via |
| 17 | + `HttpURLConnection` (in `http/1.1` mode). |
12 | 18 | * Updated the minimum Android API Level validation from 10 to **21**. As with previous jsoup versions, Android
|
13 | 19 | developers need to enable core library desugaring. The minimum Java version remains Java 8.
|
14 |
| - [2173](https://github.com/jhy/jsoup/pull/2173) |
| 20 | + [#2173](https://github.com/jhy/jsoup/pull/2173) |
15 | 21 | * Removed previously deprecated class: `org.jsoup.UncheckedIOException` (replace with `java.io.UncheckedIOException`);
|
16 | 22 | moved previously deprecated method `Element Element#forEach(Consumer)` to
|
17 |
| - `void Element#forEach(Consumer())`. [2246](https://github.com/jhy/jsoup/pull/2246) |
| 23 | + `void Element#forEach(Consumer())`. [#2246](https://github.com/jhy/jsoup/pull/2246) |
18 | 24 | * Deprecated the methods `Document#updateMetaCharsetElement(bool)` and `#Document#updateMetaCharsetElement()`, as the
|
19 | 25 | setting had no effect. When `Document#charset(Charset)` is called, the document's meta charset or XML encoding
|
20 |
| - instruction is always set. [2247](https://github.com/jhy/jsoup/pull/2247) |
| 26 | + instruction is always set. [#2247](https://github.com/jhy/jsoup/pull/2247) |
21 | 27 |
|
22 | 28 | ### Improvements
|
23 | 29 |
|
24 | 30 | * When cleaning HTML with a `Safelist` that preserves relative links, the `isValid()` method will now consider these
|
25 | 31 | links valid. Additionally, the enforced attribute `rel=nofollow` will only be added to external links when configured
|
26 |
| - in the safelist. [2245](https://github.com/jhy/jsoup/pull/2245) |
| 32 | + in the safelist. [#2245](https://github.com/jhy/jsoup/pull/2245) |
27 | 33 | * Added `Element#selectStream(String query)` and `Element#selectStream(Evaluator)` methods, that return a `Stream` of
|
28 | 34 | matching elements. Elements are evaluated and returned as they are found, and the stream can be
|
29 |
| - terminated early. [2092](https://github.com/jhy/jsoup/pull/2092) |
| 35 | + terminated early. [#2092](https://github.com/jhy/jsoup/pull/2092) |
30 | 36 | * `Element` objects now implement `Iterable`, enabling them to be used in enhanced for loops.
|
31 | 37 | * Added support for fragment parsing from a `Reader` via
|
32 |
| - `Parser#parseFragmentInput(Reader, Element, String)`. [1177](https://github.com/jhy/jsoup/issues/1177) |
33 |
| -* Reintroduced CLI executable examples, in `jsoup-examples.jar`. [1702](https://github.com/jhy/jsoup/issues/1702) |
| 38 | + `Parser#parseFragmentInput(Reader, Element, String)`. [#1177](https://github.com/jhy/jsoup/issues/1177) |
| 39 | +* Reintroduced CLI executable examples, in `jsoup-examples.jar`. [#1702](https://github.com/jhy/jsoup/issues/1702) |
34 | 40 | * Optimized performance of selectors like `#id .class` (and other similar descendant queries) by around 4.6x, by better
|
35 | 41 | balancing the Ancestor evaluator's cost function in the query
|
36 |
| - planner. [2254](https://github.com/jhy/jsoup/issues/2254) |
| 42 | + planner. [#2254](https://github.com/jhy/jsoup/issues/2254) |
37 | 43 | * Removed the legacy parsing rules for `<isindex>` tags, which would autovivify a `form` element with labels. This is no
|
38 | 44 | longer in the spec.
|
39 | 45 | * Added `Elements.selectFirst(String cssQuery)` and `Elements.expectFirst(String cssQuery)`, to select the first
|
40 |
| - matching element from an `Elements` list. [2263](https://github.com/jhy/jsoup/pull/2263/) |
| 46 | + matching element from an `Elements` list. [#2263](https://github.com/jhy/jsoup/pull/2263/) |
41 | 47 | * When parsing with the XML parser, XML Declarations and Processing Instructions are directly handled, vs bouncing
|
42 | 48 | through the HTML parser's bogus comment handler. Serialization for non-doctype declarations no longer end with a
|
43 |
| - spurious `!`. [2275](https://github.com/jhy/jsoup/pull/2275) |
| 49 | + spurious `!`. [#2275](https://github.com/jhy/jsoup/pull/2275) |
44 | 50 | * When converting parsed HTML to XML or the W3C DOM, element names containing `<` are normalized to `_` to ensure valid
|
45 | 51 | XML. For example, `<foo<bar>` becomes `<foo_bar>`, as XML does not allow `<` in element names, but HTML5
|
46 |
| - does. [2276](https://github.com/jhy/jsoup/pull/2276) |
47 |
| -* Reimplemented the HTML5 Adoption Agency Algorithm to the current spec. This handles mis-nested formating / structural elements. [2278](https://github.com/jhy/jsoup/pull/2278) |
| 52 | + does. [#2276](https://github.com/jhy/jsoup/pull/2276) |
| 53 | +* Reimplemented the HTML5 Adoption Agency Algorithm to the current spec. This handles mis-nested formating / structural elements. [#2278](https://github.com/jhy/jsoup/pull/2278) |
48 | 54 |
|
49 | 55 | ### Bug Fixes
|
50 | 56 |
|
51 | 57 | * If an element has an `;` in an attribute name, it could not be converted to a W3C DOM element, and so subsequent XPath
|
52 | 58 | queries could miss that element. Now, the attribute name is more completely
|
53 |
| - normalized. [2244](https://github.com/jhy/jsoup/issues/2244) |
| 59 | + normalized. [#2244](https://github.com/jhy/jsoup/issues/2244) |
54 | 60 | * For backwards compatibility, reverted the internal attribute key for doctype names to
|
55 |
| - "name". [2241](https://github.com/jhy/jsoup/issues/2241) |
| 61 | + "name". [#2241](https://github.com/jhy/jsoup/issues/2241) |
56 | 62 | * In `Connection`, skip cookies that have no name, rather than throwing a validation
|
57 |
| - exception. [2242](https://github.com/jhy/jsoup/issues/2242) |
| 63 | + exception. [#2242](https://github.com/jhy/jsoup/issues/2242) |
58 | 64 | * When running on JDK 1.8, the error `java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;`
|
59 | 65 | could be thrown when calling `Response#body()` after parsing from a URL and the buffer size was
|
60 |
| - exceeded. [2250](https://github.com/jhy/jsoup/pull/2250) |
| 66 | + exceeded. [#2250](https://github.com/jhy/jsoup/pull/2250) |
61 | 67 | * For backwards compatibility, allow `null` InputStream inputs to `Jsoup.parse(InputStream stream, ...)`, by returning
|
62 |
| - an empty `Document`. [2252](https://github.com/jhy/jsoup/issues/2252) |
| 68 | + an empty `Document`. [#2252](https://github.com/jhy/jsoup/issues/2252) |
63 | 69 | * A `template` tag containing an `li` within an open `li` would be parsed incorrectly, as it was not recognized as a
|
64 | 70 | "special" tag (which have additional processing rules). Also, added the SVG and MathML namespace tags to the list of
|
65 |
| - special tags. [2258](https://github.com/jhy/jsoup/issues/2258) |
| 71 | + special tags. [#2258](https://github.com/jhy/jsoup/issues/2258) |
66 | 72 | * A `template` tag containing a `button` within an open `button` would be parsed incorrectly, as the "in button scope"
|
67 | 73 | check was not aware of the `template` element. Corrected other instances including MathML and SVG elements,
|
68 |
| - also. [2271](https://github.com/jhy/jsoup/issues/2271) |
| 74 | + also. [#2271](https://github.com/jhy/jsoup/issues/2271) |
69 | 75 | * An `:nth-child` selector with a negative digit-less step, such as `:nth-child(-n+2)`, would be parsed incorrectly as a
|
70 |
| - positive step, and so would not match as expected. [1147](https://github.com/jhy/jsoup/issues/1147) |
| 76 | + positive step, and so would not match as expected. [#1147](https://github.com/jhy/jsoup/issues/1147) |
71 | 77 | * Calling `doc.charset(charset)` on an empty XML document would throw an
|
72 |
| - `IndexOutOfBoundsException`. [2266](https://github.com/jhy/jsoup/issues/2266) |
| 78 | + `IndexOutOfBoundsException`. [#2266](https://github.com/jhy/jsoup/issues/2266) |
73 | 79 | * Fixed a memory leak when reusing a nested `StructuralEvaluator` (e.g., a selector ancestor chain like `A B C`) by
|
74 |
| - ensuring cache reset calls cascade to inner members. [2277](https://github.com/jhy/jsoup/issues/2277) |
75 |
| -* Concurrent calls to `doc.clone().append(html)` were not supported. When a document was cloned, its `Parser` was not cloned but was a shallow copy of the original parser. [2281](https://github.com/jhy/jsoup/issues/2281) |
| 80 | + ensuring cache reset calls cascade to inner members. [#2277](https://github.com/jhy/jsoup/issues/2277) |
| 81 | +* Concurrent calls to `doc.clone().append(html)` were not supported. When a document was cloned, its `Parser` was not cloned but was a shallow copy of the original parser. [#2281](https://github.com/jhy/jsoup/issues/2281) |
76 | 82 |
|
77 | 83 | ## 1.18.3 (2024-Dec-02)
|
78 | 84 |
|
|
0 commit comments