Mangadex fix alt title being removed by cleanDescription (#1378)
* Update MdUtil.kt * Update ApiMangaParser.kt * Update MdUtil.kt
This commit is contained in:
parent
5f19859589
commit
9b6600d31f
@ -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…
x
Reference in New Issue
Block a user