From 9d6a2057ab6fafe5308ec10f273af2cc08ea66f3 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 4 Jan 2023 11:53:51 +0100 Subject: [PATCH] Add tags in any when pinned / Fix quotes with tags breaking lines --- .../java/app/fedilab/android/activities/HashTagActivity.java | 2 ++ .../main/java/app/fedilab/android/helper/SpannableHelper.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java b/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java index 7bf49af50..af6b0c533 100644 --- a/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/HashTagActivity.java @@ -221,6 +221,8 @@ public class HashTagActivity extends BaseActivity { tagTimeline.name = stripTag.trim(); tagTimeline.isNSFW = false; tagTimeline.isART = false; + tagTimeline.any = new ArrayList<>(); + tagTimeline.any.add(stripTag.trim()); pinnedTimeline.tagTimeline = tagTimeline; pinned.pinnedTimelines.add(pinnedTimeline); if (update) { diff --git a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java index b75b5d3ce..dad5c73bf 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -124,7 +124,7 @@ public class SpannableHelper { if (status != null && status.mentions != null) { mentions.addAll(status.mentions); } - text = text.replaceAll("((<\\s?p\\s?>|<\\s?br\\s?/?>)>(((?!([<])).)*))", "$2
$3
"); + text = text.replaceAll("((<\\s?p\\s?>|<\\s?br\\s?/?>)>(((?!(<\\s?br\\s?/?>|<\\s?/s?p\\s?>)).)*))", "$2
$3
"); text = text.trim().replaceAll("\\s{3}", "   "); text = text.trim().replaceAll("\\s{2}", "  "); SpannableString initialContent;