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
This commit is contained in:
curche 2021-06-05 03:43:04 +05:30 committed by GitHub
parent bfe4ac9efd
commit ba1da0be4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'xkcd' extName = 'xkcd'
pkgNameSuffix = 'en.xkcd' pkgNameSuffix = 'en.xkcd'
extClass = '.Xkcd' extClass = '.Xkcd'
extVersionCode = 9 extVersionCode = 10
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -59,11 +59,11 @@ class Xkcd : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val titleWords: Sequence<String> val titleWords: Sequence<String>
val altTextWords: Sequence<String> val altTextWords: Sequence<String>
val interactiveText = listOf( val interactiveText = """
"To experience the", "interactive version of this comic,", |To experience the interactive version of this comic,
"open it in WebView/browser." |open it in WebView/browser.
) """.trimMargin("|")
.joinToString(separator = "%0A") .replace("\n", "%0A")
.replace(" ", "%20") .replace(" ", "%20")
// transforming filename from info.0.json isn't guaranteed to work, stick to html // transforming filename from info.0.json isn't guaranteed to work, stick to html