From 89fae49fd31cedc934538621eb71ee538709c77f Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 26 Oct 2021 11:16:45 +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/AnalyzeRule.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index bf685944e..6d3bae885 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -262,9 +262,10 @@ class AnalyzeRule( /** * 获取Element */ - fun getElement(ruleStr: String): Any? { + fun getElement(ruleStr: String, mContent: Any? = null): Any? { if (TextUtils.isEmpty(ruleStr)) return null var result: Any? = null + val content = mContent ?: this.content val ruleList = splitSourceRule(ruleStr, true) content?.let { o -> if (ruleList.isNotEmpty()) result = o @@ -295,8 +296,9 @@ class AnalyzeRule( * 获取列表 */ @Suppress("UNCHECKED_CAST") - fun getElements(ruleStr: String): List { + fun getElements(ruleStr: String, mContent: Any? = null): List { var result: Any? = null + val content = mContent ?: this.content val ruleList = splitSourceRule(ruleStr, true) content?.let { o -> if (ruleList.isNotEmpty()) result = o