From 0e8aad3b9fc9463031a2374e149b2eeaad63ca66 Mon Sep 17 00:00:00 2001 From: FlaminSarge Date: Sun, 11 Jun 2023 05:14:00 -0700 Subject: [PATCH] [Mangadex] Call removeEntitiesAndMarkdown on desc before appending altTitles to it (#16711) * [Mangadex] Call removeEntitiesAndMarkdown on desc before appending altTitles to it * Bump extVersionCode --- src/all/mangadex/build.gradle | 2 +- .../tachiyomi/extension/all/mangadex/MangaDexHelper.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index b36741aec..581a2e4a8 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'MangaDex' pkgNameSuffix = 'all.mangadex' extClass = '.MangaDexFactory' - extVersionCode = 179 + extVersionCode = 180 isNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt index afffb530f..a6afba34e 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt @@ -335,7 +335,7 @@ class MangaDexHelper(lang: String) { val genreList = MDConstants.tagGroupsOrder.flatMap { genresMap[it].orEmpty() } + nonGenres - var desc = attr.description[lang] ?: attr.description["en"] ?: "" + var desc = (attr.description[lang] ?: attr.description["en"] ?: "").removeEntitiesAndMarkdown() if (altTitlesInDesc) { val romanizedOriginalLang = MDConstants.romanizedLangCodes[attr.originalLanguage] ?: "" @@ -343,12 +343,12 @@ class MangaDexHelper(lang: String) { .mapNotNull { it.values.singleOrNull() } if (altTitles.isNotEmpty()) { val altTitlesDesc = intl.altTitleText + altTitles.joinToString("\n", "\n") - desc += (if (desc.isNullOrBlank()) "" else "\n\n") + altTitlesDesc + desc += (if (desc.isNullOrBlank()) "" else "\n\n") + altTitlesDesc.removeEntitiesAndMarkdown() } } return createBasicManga(mangaDataDto, coverFileName, coverSuffix, lang).apply { - description = desc.removeEntitiesAndMarkdown() + description = desc author = authors.joinToString(", ") artist = artists.joinToString(", ") status = getPublicationStatus(attr, chapters)