Skip to content

Commit

Permalink
fix: fix styling with highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
ShindouMihou committed Dec 2, 2023
1 parent 9296a21 commit b7002ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface TextStyles {
}

if (spoiler) {
prefix += "||"
prefix = "||$prefix"
suffix = "$suffix||"
}

Expand Down
17 changes: 17 additions & 0 deletions src/test/java/react/TextStylesTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package react

import org.junit.jupiter.api.Test
import pw.mihou.nexus.features.react.styles.TextStyles
import kotlin.test.assertEquals

class TextStylesTest: TextStyles {
companion object {
const val PLACEHOLDER_TEXT = "Hello World"
}

@Test
fun `test stacked styling`() {
val result = p(PLACEHOLDER_TEXT, bold = true, underline = true, italic = true, strikethrough = true, spoiler = true)
assertEquals("||***__~~Hello World~~__***||", result)
}
}

0 comments on commit b7002ac

Please sign in to comment.