paug / AndroidMakersApp

📱Official companion app for Android Makers by droidcon 🇫🇷
https://androidmakers.droidcon.com/
120 stars 27 forks source link

Line breaks not supported in session description #253

Closed RobinCaroff closed 5 months ago

RobinCaroff commented 5 months ago

Line breaks not supported in session description.

This is particularly visible with Devlicious or App-Clinic sessions descriptions but also happens with other sessions.

This is due to the `removeHtmlTags' instruction : https://github.com/paug/AndroidMakersApp/blob/8917af5b7a458f478b2a915e744479e59d6a5127/shared/ui/src/commonMain/kotlin/com/androidmakers/ui/agenda/SessionDetailLayout.kt#L223

Here are web vs Android apps screenshot comparisons :

Artboard1

Artboard1_2

Environment

Happens with the Android app Looks fine on iOS.

Steps to reproduce

Opens the App-Clinic session details.

BoD commented 5 months ago

I don't know why 😅 but FWIW it looks like the problem's not there on WearOS

Screenshot_1712757240

RobinCaroff commented 5 months ago

I have a dirty fix :

text = sessionDetails.session.description?.replace("\n", "<br />")?.removeHtmlTags() ?: "",

but I wonder if it would not be better to do it in the Sessionize data import script on the server side. Ping @martinbonnin @BoD

martinbonnin commented 5 months ago

If I understand correctly, format choices for Session.description are:

Am I correct?

I think I prefer the current state where the backend data is transfered using a JSON encoded (hence containing \n). I prefer that over HTML that is generally wayyyyyyy more complicated to handle. Markdown could be nice too but if WearOS and iOS are OK already, replacing the /n -> <br/> is probably the path of least resistance?

RobinCaroff commented 5 months ago

OK I'll make a fix.