diff --git a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/message/RichMessageParser.kt b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/message/RichMessageParser.kt index cb26b5b..1506c86 100644 --- a/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/message/RichMessageParser.kt +++ b/matrix/services/sync/src/main/kotlin/app/dapk/st/matrix/sync/internal/sync/message/RichMessageParser.kt @@ -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() .dropWhile { it.startsWith("> ") || it.isEmpty() } diff --git a/matrix/services/sync/src/test/kotlin/app/dapk/st/matrix/sync/internal/sync/RichMessageParserTest.kt b/matrix/services/sync/src/test/kotlin/app/dapk/st/matrix/sync/internal/sync/RichMessageParserTest.kt index e910a07..69622d4 100644 --- a/matrix/services/sync/src/test/kotlin/app/dapk/st/matrix/sync/internal/sync/RichMessageParserTest.kt +++ b/matrix/services/sync/src/test/kotlin/app/dapk/st/matrix/sync/internal/sync/RichMessageParserTest.kt @@ -38,8 +38,14 @@ class RichMessageParserTest { @Test fun `replaces apostrophe entity`() = runParserTest( - input = "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"))) + ), + Case( + input = "Hello world! foo's bar", + expected = RichText(listOf(Normal("Hello world! foo's bar"))) + ), ) @Test