Mangadex fix alt title being removed by cleanDescription (jobobby04/TachiyomiSY#1378)
* Update MdUtil.kt * Update ApiMangaParser.kt * Update MdUtil.kt (cherry picked from commit 9b6600d31f67742a9cb053af51cc36735b8d9a66)
This commit is contained in:
parent
69b1af8534
commit
724d10c086
2 changed files with 5 additions and 5 deletions
|
|
@ -96,9 +96,9 @@ class ApiMangaParser(
|
|||
originalLanguage = mangaAttributesDto.originalLanguage,
|
||||
).orEmpty()
|
||||
|
||||
description = MdUtil.cleanDescription(
|
||||
if (altTitlesInDesc) MdUtil.addAltTitleToDesc(rawDesc, altTitles) else rawDesc,
|
||||
)
|
||||
val cleanDesc = MdUtil.cleanDescription(rawDesc)
|
||||
|
||||
description = if (altTitlesInDesc) MdUtil.addAltTitleToDesc(cleanDesc, altTitles) else cleanDesc
|
||||
|
||||
authors = mangaRelationshipsDto.filter { relationshipDto ->
|
||||
relationshipDto.type.equals(MdConstants.Types.author, true)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class MdUtil {
|
|||
|
||||
fun cleanDescription(string: String): String {
|
||||
return Parser.unescapeEntities(string, false)
|
||||
.substringBefore("---")
|
||||
.substringBefore("\n---")
|
||||
.replace(markdownLinksRegex, "$1")
|
||||
.replace(markdownItalicBoldRegex, "$1")
|
||||
.replace(markdownItalicRegex, "$1")
|
||||
|
|
@ -265,7 +265,7 @@ class MdUtil {
|
|||
} else {
|
||||
val altTitlesDesc = altTitles
|
||||
.joinToString("\n", "${Injekt.get<Application>().getString(R.string.alt_titles)}:\n") { "• $it" }
|
||||
description + (if (description.isBlank()) "" else "\n\n") + altTitlesDesc
|
||||
description + (if (description.isBlank()) "" else "\n\n") + Parser.unescapeEntities(altTitlesDesc, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue