replacing & html entity with &
This commit is contained in:
parent
c6a6dd9bd3
commit
718fb681c3
|
@ -56,7 +56,7 @@ class RichMessageParser {
|
|||
|
||||
}
|
||||
|
||||
private fun String.removeHtmlEntities() = this.replace(""", "\"").replace("'", "'").replace("'", "'")
|
||||
private fun String.removeHtmlEntities() = this.replace(""", "\"").replace("'", "'").replace("'", "'").replace("&", "&")
|
||||
|
||||
private fun String.dropTextFallback() = this.lines()
|
||||
.dropWhile { it.startsWith("> ") || it.isEmpty() }
|
||||
|
|
|
@ -36,6 +36,12 @@ class RichMessageParserTest {
|
|||
expected = RichText(listOf(Normal("Hello world! \"foo bar\"")))
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `replaces ampersand entity`() = runParserTest(
|
||||
input = "Hello & world!",
|
||||
expected = RichText(listOf(Normal("Hello & world!")))
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `replaces apostrophe entity`() = runParserTest(
|
||||
Case(
|
||||
|
|
Loading…
Reference in New Issue