handle apos; html entity
This commit is contained in:
parent
58730470f6
commit
1bfc2fd670
|
@ -56,7 +56,7 @@ class RichMessageParser {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun String.removeHtmlEntities() = this.replace(""", "\"").replace("'", "'")
|
private fun String.removeHtmlEntities() = this.replace(""", "\"").replace("'", "'").replace("'", "'")
|
||||||
|
|
||||||
private fun String.dropTextFallback() = this.lines()
|
private fun String.dropTextFallback() = this.lines()
|
||||||
.dropWhile { it.startsWith("> ") || it.isEmpty() }
|
.dropWhile { it.startsWith("> ") || it.isEmpty() }
|
||||||
|
|
|
@ -38,8 +38,14 @@ class RichMessageParserTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `replaces apostrophe entity`() = runParserTest(
|
fun `replaces apostrophe entity`() = runParserTest(
|
||||||
|
Case(
|
||||||
input = "Hello world! foo's bar",
|
input = "Hello world! foo's bar",
|
||||||
expected = RichText(listOf(Normal("Hello world! foo's bar")))
|
expected = RichText(listOf(Normal("Hello world! foo's bar")))
|
||||||
|
),
|
||||||
|
Case(
|
||||||
|
input = "Hello world! foo's bar",
|
||||||
|
expected = RichText(listOf(Normal("Hello world! foo's bar")))
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue