diff --git a/shared/domain/src/androidMain/kotlin/fr/androidmakers/domain/utils/TextUtils.android.kt b/shared/domain/src/androidMain/kotlin/fr/androidmakers/domain/utils/TextUtils.android.kt deleted file mode 100644 index 769c286f..00000000 --- a/shared/domain/src/androidMain/kotlin/fr/androidmakers/domain/utils/TextUtils.android.kt +++ /dev/null @@ -1,14 +0,0 @@ -package fr.androidmakers.domain.utils - -import android.text.Html - -actual fun String.removeHtmlTags(): String { - /** - * Discards HTML information from a String - * - * In order to keep the style information, we'd need something that does HTML -> AnnotatedString - * or Spanned -> AnnotatedString which doesn't seem to exist - * See https://stackoverflow.com/questions/66494838/android-compose-how-to-use-html-tags-in-a-text-view#comment117551793_66494838 - */ - return Html.fromHtml(this, Html.FROM_HTML_MODE_COMPACT).toString() -} diff --git a/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/utils/TextUtils.kt b/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/utils/TextUtils.kt deleted file mode 100644 index 03afc51e..00000000 --- a/shared/domain/src/commonMain/kotlin/fr/androidmakers/domain/utils/TextUtils.kt +++ /dev/null @@ -1,3 +0,0 @@ -package fr.androidmakers.domain.utils - -expect fun String.removeHtmlTags(): String diff --git a/shared/domain/src/iosMain/kotlin/fr/androidmakers/domain/utils/TextUtils.ios.kt b/shared/domain/src/iosMain/kotlin/fr/androidmakers/domain/utils/TextUtils.ios.kt deleted file mode 100644 index d15267c2..00000000 --- a/shared/domain/src/iosMain/kotlin/fr/androidmakers/domain/utils/TextUtils.ios.kt +++ /dev/null @@ -1,24 +0,0 @@ -@file:Suppress("CAST_NEVER_SUCCEEDS") - -package fr.androidmakers.domain.utils - -import kotlinx.cinterop.ExperimentalForeignApi - -@OptIn(ExperimentalForeignApi::class) -actual fun String.removeHtmlTags(): String { - /*if (this.isBlank()) { - return "" - } else { - return NSString.create(string = this).dataUsingEncoding(NSUTF8StringEncoding)?.let { data -> - val attributed = NSAttributedString.create( - data, - mapOf(NSDocumentTypeDocumentOption to NSHTMLTextDocumentType), - null, - null - ) - return attributed?.string ?: "" - } ?: "" - }*/ - // TODO the above method does not work - return this -} diff --git a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt index e6066ea8..def66a47 100644 --- a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt +++ b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt @@ -11,10 +11,8 @@ import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState @@ -49,7 +47,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -66,7 +63,6 @@ import dev.icerock.moko.resources.compose.stringResource import fr.androidmakers.domain.model.SocialsItem import fr.androidmakers.domain.model.Speaker import fr.androidmakers.domain.model.isAppClinic -import fr.androidmakers.domain.utils.removeHtmlTags import fr.paug.androidmakers.ui.MR import io.openfeedback.m3.OpenFeedback import io.openfeedback.viewmodels.OpenFeedbackFirebaseConfig @@ -220,7 +216,7 @@ private fun SessionDetails( Text( modifier = Modifier.padding(top = 16.dp), - text = sessionDetails.session.description?.removeHtmlTags() ?: "", + text = sessionDetails.session.description ?: "", textAlign = TextAlign.Start, style = MaterialTheme.typography.bodyLarge, ) diff --git a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/venue/VenueScreen.kt b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/venue/VenueScreen.kt index df421181..bedc9f35 100644 --- a/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/venue/VenueScreen.kt +++ b/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/venue/VenueScreen.kt @@ -20,7 +20,6 @@ import androidx.compose.ui.unit.dp import com.androidmakers.ui.model.UIVenue import com.seiko.imageloader.rememberImagePainter import dev.icerock.moko.resources.compose.stringResource -import fr.androidmakers.domain.utils.removeHtmlTags import fr.paug.androidmakers.ui.MR @Composable @@ -61,7 +60,7 @@ fun VenueLayout( uiVenue.descriptionEn } Text( - text = description.removeHtmlTags(), + text = description, modifier = Modifier.padding(8.dp), style = MaterialTheme.typography.bodyMedium, )