From 1e35658d44f62bc37737066bbf0b2cbaedbadfcc Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Mon, 18 Mar 2024 11:56:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt | 7 +++---- gradle/libs.versions.toml | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt index 328be0533..1ef7db8d3 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSoup.kt @@ -53,7 +53,7 @@ class AnalyzeByJSoup(doc: Any) { if (list.isEmpty()) { return null } - if (list.size == 1){ + if (list.size == 1) { return list.first() } return list.joinToString("\n") @@ -375,12 +375,11 @@ class AnalyzeByJSoup(doc: Any) { * 根据索引集合筛选元素 * */ if (split == '!') { //排除 - /* + for (pcInt in indexSet) elements[pcInt] = null elements.removeAll(nullSet) //测试过,这样就行 - */ - for (pcInt in indexSet.toList().sortedDescending()) elements.removeAt(pcInt) + } else if (split == '.') { //选择 val es = Elements() diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cfd33fce0..31382d52c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,9 @@ lifecycle = "2.7.0" glide = "4.16.0" gson = "2.10.1" jsonPath = "2.9.0" -jsoup = "1.17.2" +# issue #3811,不要更新版本,新版引入了一个破坏性变更(详见https://github.com/jhy/jsoup/pull/2017) +# 若要升级请确保相关代码不会受此变更影响(如AnalyzeByJSoup.kt、JsoupXpath库等) +jsoup = "1.16.2" jsoupxpath = "2.5.3" coroutines = "1.8.0" liveeventbus = "1.8.14"