Remove spaces at end of line before removing multiple new lines (#5928)

(cherry picked from commit 45fad147bfcc10d0fcece135d2196e74bda4a15e)
This commit is contained in:
Andreas 2021-09-18 21:16:03 +02:00 committed by Jobobby04
parent 970967104e
commit 3d5e5da022

View File

@ -481,10 +481,12 @@ class MangaInfoHeaderAdapter(
}
}
private fun updateDescription(description: String?, isCurrentlyExpanded: Boolean): CharSequence? {
private fun updateDescription(description: String?, isCurrentlyExpanded: Boolean): CharSequence {
return when {
description.isNullOrBlank() -> view.context.getString(R.string.unknown)
isCurrentlyExpanded -> description.replace(Regex("[\\r\\n]{2,}", setOf(RegexOption.MULTILINE)), "\n")
isCurrentlyExpanded -> description
.replace(Regex(" +\$", setOf(RegexOption.MULTILINE)), "")
.replace(Regex("[\\r\\n]{2,}", setOf(RegexOption.MULTILINE)), "\n")
else -> description
}
}