diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/utils/StringsUtils.java b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/StringsUtils.java index a2b8437..86a0749 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/utils/StringsUtils.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/utils/StringsUtils.java @@ -148,4 +148,14 @@ public class StringsUtils { return result; } + + /** + * Remove all BBCode tags of a given string + * + * @param string The string to update + * @return The same string, without any bbcode tags + */ + public static String RemoveBBCode(String string){ + return string.replaceAll("\\[[a-zA-Z1-9/=#]{1,10}]", ""); + } } diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java index 3f8d41a..629aa77 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/adapters/PostsAdapter.java @@ -20,6 +20,7 @@ import org.communiquons.android.comunic.client.data.enums.PageType; import org.communiquons.android.comunic.client.data.models.Comment; import org.communiquons.android.comunic.client.data.models.Post; import org.communiquons.android.comunic.client.data.models.UserInfo; +import org.communiquons.android.comunic.client.data.utils.StringsUtils; import org.communiquons.android.comunic.client.data.utils.TimeUtils; import org.communiquons.android.comunic.client.ui.listeners.onPostUpdateListener; import org.communiquons.android.comunic.client.ui.utils.UiUtils; @@ -315,7 +316,11 @@ public class PostsAdapter extends BaseRecyclerViewAdapter { //Set post content - mPostContent.setParsedText(UiUtils.prepareStringTextView(post.getContent())); + mPostContent.setParsedText( + StringsUtils.RemoveBBCode( + UiUtils.prepareStringTextView(post.getContent()) + ) + ); //Post likes