From 6ec2bc6f214c0c2dbada4a5d7b3511148d3aa338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 12 Mar 2020 13:55:02 +0100 Subject: [PATCH] [API/Mobidziennik] Fix duplicated line breaks when getting message. --- .../mobidziennik/data/web/MobidziennikWebGetMessage.kt | 2 +- .../edziennik/ui/modules/messages/MessagesUtils.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebGetMessage.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebGetMessage.kt index e4ddcc52..5b462e57 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebGetMessage.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/mobidziennik/data/web/MobidziennikWebGetMessage.kt @@ -118,7 +118,7 @@ class MobidziennikWebGetMessage(override val data: DataMobidziennik, // this needs to be at the end message.apply { - this.body = body.html().replace("\n", "
") + this.body = body.html() clearAttachments() content.select("ul li").map { it.select("a").first() }.forEach { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.kt index 1842a71e..448e8ea5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesUtils.kt @@ -203,7 +203,7 @@ object MessagesUtils { } return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - Html.fromHtml(text, Html.FROM_HTML_MODE_COMPACT) + Html.fromHtml(text, Html.FROM_HTML_MODE_LEGACY) } else { Html.fromHtml(text) }