From cd337b000ece6ce506dcd74536a6360dde23e26a Mon Sep 17 00:00:00 2001 From: Kanahia <114223204+kanahia1@users.noreply.github.com> Date: Mon, 25 Mar 2024 04:59:30 +0530 Subject: [PATCH] Fixed Blue square appears at end of description of image uploaded (#5616) * Fixed Grey empty screen at Upload wizard caption step after denying files permission * Empty commit * Fixed loop issue * Created docs for earlier commits * Fixed javadoc * Fixed spaces * Added added basic features to OSM Maps * Added search location feature * Added filter to Open Street Maps * Fixed chipGroup in Open Street Maps * Removed mapBox code * Removed mapBox's code * Reformat code * Reformatted code * Removed rotation feature to map * Removed rotation files and Fixed Marker click problem * Ignored failing tests * Added voice input feature * Fixed test cases * Changed caption and description text * Replaced mapbox to osmdroid in upload activity * Fixed Unit Tests * Made selected marker to be fixed on map * Changed color of map marker * Fixes #4345 * Delete app/src/main/res/values-yue-hant directory * Added comment explaining the context --------- Co-authored-by: Nicolas Raoul --- .../fr/free/nrw/commons/media/MediaDetailFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java index 063cac034..40bc5a1d4 100644 --- a/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java @@ -1300,7 +1300,12 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment implements } private String prettyDescription(Media media) { - final String description = chooseDescription(media); + String description = chooseDescription(media); + if (!description.isEmpty()) { + // Remove img tag that sometimes appears as a blue square in the app, + // see https://github.com/commons-app/apps-android-commons/issues/4345 + description = description.replaceAll("[<](/)?img[^>]*[>]", ""); + } return description.isEmpty() ? getString(R.string.detail_description_empty) : description; }