diff --git a/app/build.gradle b/app/build.gradle index 08f47c12b..c15bcc12f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -82,7 +82,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.2.0-alpha02' implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.preference:preference:1.1.0-rc01' - implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1' implementation 'com.google.android.material:material:1.1.0-alpha07' implementation 'com.google.android:flexbox:1.1.0' 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 cb93e6758..7f4167271 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 @@ -133,16 +133,6 @@ class AnalyzeByJSoup { } } } - if (!isEmpty(sourceRule.replaceRegex)) { - val tempList = ArrayList(textS) - textS.clear() - for (text in tempList) { - val tmpText = text.replace(sourceRule.replaceRegex.toRegex(), sourceRule.replacement) - if (tmpText.isNotEmpty()) { - textS.add(tmpText) - } - } - } return textS } @@ -409,24 +399,13 @@ class AnalyzeByJSoup { internal inner class SourceRule(ruleStr: String) { var isCss = false var elementsRule: String - var replaceRegex = "" - var replacement = "" init { if (ruleStr.startsWith("@CSS:", true)) { isCss = true elementsRule = ruleStr.substring(5).trim { it <= ' ' } } else { - val ruleStrS: Array = - ruleStr.trim { it <= ' ' }.split("#".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - //分离正则表达式 - elementsRule = ruleStrS[0] - if (ruleStrS.size > 1) { - replaceRegex = ruleStrS[1] - } - if (ruleStrS.size > 2) { - replacement = ruleStrS[2] - } + elementsRule = ruleStr } } }