Skip to content

Commit

Permalink
fix: make sure text after an empty quote is rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
AkesiSeli committed Nov 1, 2024
1 parent ed752a7 commit 2ca31a1
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ private fun String.spoilerFixUp(): String =
private fun String.quoteFixUp(): String =
run {
val finalLines = mutableListOf<String>()
val quoteAndList = Regex("^>-")
val quoteEmpty = Regex("^>\\s*$")
lines().forEach { line ->
// removes list inside quotes
val quoteAndList = Regex("^>-")
val cleanLine = line.replace(quoteAndList, "-")

val cleanLine =
line
// removes list inside quotes
.replace(quoteAndList, "-")
// replace empty quotes
.replace(quoteEmpty, " \n")
val isLastEmpty = finalLines.isNotEmpty() && finalLines.last().isEmpty()
if (!isLastEmpty || cleanLine.isNotEmpty()) {
finalLines += cleanLine
Expand Down

0 comments on commit 2ca31a1

Please sign in to comment.