From ba1da0be4ca3db806d54cef04fa68d292706084e Mon Sep 17 00:00:00 2001 From: curche <72807749+curche@users.noreply.github.com> Date: Sat, 5 Jun 2021 03:43:04 +0530 Subject: [PATCH] Use TrimMargin instead of listOf in xkcd string thrown on error (#7470) * refactor string used to throw error in xkcd makes a minor change to code I PRd a while back refer: https://github.com/tachiyomiorg/tachiyomi-extensions/pull/6474 changed listOf to trimMargin because it looked cleaner and a more kotlin way to do it * bump versioncode for xkcd otherwise it might not update the extension --- src/en/xkcd/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/en/xkcd/Xkcd.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/en/xkcd/build.gradle b/src/en/xkcd/build.gradle index 5287edba3..afd66e92c 100644 --- a/src/en/xkcd/build.gradle +++ b/src/en/xkcd/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'xkcd' pkgNameSuffix = 'en.xkcd' extClass = '.Xkcd' - extVersionCode = 9 + extVersionCode = 10 libVersion = '1.2' } diff --git a/src/en/xkcd/src/eu/kanade/tachiyomi/extension/en/xkcd/Xkcd.kt b/src/en/xkcd/src/eu/kanade/tachiyomi/extension/en/xkcd/Xkcd.kt index bb2480f4b..eeae3f4ce 100644 --- a/src/en/xkcd/src/eu/kanade/tachiyomi/extension/en/xkcd/Xkcd.kt +++ b/src/en/xkcd/src/eu/kanade/tachiyomi/extension/en/xkcd/Xkcd.kt @@ -59,11 +59,11 @@ class Xkcd : ParsedHttpSource() { override fun pageListParse(document: Document): List { val titleWords: Sequence val altTextWords: Sequence - val interactiveText = listOf( - "To experience the", "interactive version of this comic,", - "open it in WebView/browser." - ) - .joinToString(separator = "%0A") + val interactiveText = """ + |To experience the interactive version of this comic, + |open it in WebView/browser. + """.trimMargin("|") + .replace("\n", "%0A") .replace(" ", "%20") // transforming filename from info.0.json isn't guaranteed to work, stick to html