mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Remove spaces at end of line before removing multiple new lines (#5928)
This commit is contained in:
parent
3664195c71
commit
45fad147bf
1 changed files with 4 additions and 2 deletions
|
@ -365,10 +365,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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue