-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix Nearby description showing raw HTML tags #6595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix Nearby description showing raw HTML tags #6595
Conversation
|
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? |
|
Thanks a lot for your feedback :) |
|
One that was fixed recently for the author field: #5030. It's not a natural for a user to use tags, but since you're saying our codebase is inconsistent, I'll take a look at those areas and get back to you. Would you recommend having these checks for every edit text field within the codebase? |
|
Thank you, yes i think its very good idea as by checking we make sure nothing like this happens again in any field. |
|
In #5030 I worked with rendered HTML with no wiki code. Still, I think different text fields can have different expectations:
|
|
Thank you @whym for your inputs! My only point here is that we need to understand if this is happening due to some glitch or we're just dealing with user input. If it's the latter, then we need not solve for it. Users can even decide to use asterisks for bold, underscores for italic, etc. which isn't HTML but a common behaviour on chat applications. And if not, then your first point about file content retrieval would help. @Salehcodes could you please confirm the use case once and possibly share a screen cast too for the inconsistencies you were referring to? |
|
✅ Generated APK variants! |
Screen_Recording_20260103_124428_Commons.mp4As you can see here the description before pressing details button included raw html tags eg. Ps. I did not upload this image this is real user image and input which I noticed that a lot of them in my area use html tags idk why. |

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 breakNo 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)