Skip to content

Conversation

@Salehcodes
Copy link

@Salehcodes Salehcodes commented Dec 31, 2025

Description (required)

Fixes #6594

The description text shown in the Nearby map bottom sheet previously displayed raw HTML tags such as <br> and <b>, instead of rendering formatting. This reduced readability and made the UI appear visually broken.

This PR updates the description binding in ExploreMapFragment.passInfoToSheet() to use:

HtmlCompat.fromHtml(descriptionText, HtmlCompat.FROM_HTML_MODE_LEGACY)

This allows HTML to be rendered as styled text (e.g., bold and line breaks), matching the formatting already used in the Details screen.

Tests performed (required)

Tested on:

Build variant: betaDebug

Device: Samsung Galaxy S23

Android version: Android 16 (API level 35)

Steps:

Opened Explore → Map

Selected a nearby marker and tapped the bottom info banner

Verified that HTML is properly rendered:

<b> → bold text

<br> → correct line break

No visible raw HTML tags

Uploaded a test image to Beta Commons to ensure environment functionality

Test upload URL:
https://commons.wikimedia.beta.wmflabs.org/wiki/File%3ATest_html_tags.jpg

Screenshots (for UI changes only)

Screenshot_20251231_223530_Commons
Screenshot_20251231_223544_Commons

@RitikaPahwa4444
Copy link
Collaborator

Thanks @Salehcodes for your contribution. I'm not sure if users really pass HTML tags in these fields. There are some existing issues with more context around this. Could you please check those and see if this PR handles those use cases?

@Salehcodes
Copy link
Author

Thanks a lot for your feedback :)
My assumption was based on the fact that the HTML tags are already being rendered correctly in the Details screen from the same bottom sheet. So I applied similar handling here to make the behavior consistent.
If there are cases where descriptions are not expected to contain HTML, I’d be happy to review and ensure we also cover those scenarios.
Since I’m still new to the project, could you please share the related issue numbers you mentioned so I can read through the context and confirm whether this PR fully addresses them?
Thanks again for guiding me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Nearby popup description shows raw HTML tags instead of formatted text

2 participants