From e0fd6a4d3c7390c36e2591c8789016af3c43a9e4 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Sun, 18 Jul 2021 21:14:16 +0800 Subject: [PATCH] Update HtmlFormatter.kt --- app/src/main/java/io/legado/app/utils/HtmlFormatter.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt index e16a6dd5d..4ba022a73 100644 --- a/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt +++ b/app/src/main/java/io/legado/app/utils/HtmlFormatter.kt @@ -60,7 +60,8 @@ object HtmlFormatter { if (pos == 0) { val url = matcher.group(1)!! val urlMatcher = AnalyzeUrl.paramPattern.matcher(url) - NetworkUtils.getAbsoluteURL(redirectUrl,url.substring(0,urlMatcher.start())) + ',' + url.substring(urlMatcher.end()) + if(urlMatcher.find()) NetworkUtils.getAbsoluteURL(redirectUrl,url.substring(0,urlMatcher.start())) + ',' + url.substring(urlMatcher.end()) + else NetworkUtils.getAbsoluteURL(redirectUrl,url) }else NetworkUtils.getAbsoluteURL(redirectUrl,matcher.group(1)!!) }\">")