From 285bb0c385a3f46566491a7da5e58ef2fb840d44 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Wed, 26 Aug 2020 15:24:49 +0800 Subject: Fix an issue in modifyMarkdown(String markdown) in Utils.Utils about matching subreddits and users. --- app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java index f74d604e..384839bc 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/Utils.java @@ -34,7 +34,7 @@ public class Utils { private static final long YEAR_MILLIS = 12 * MONTH_MILLIS; public static String modifyMarkdown(String markdown) { - StringBuilder regexed = new StringBuilder(markdown.replaceAll("((?<=[\\s])|^)/{0,1}[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com/$0)")); + StringBuilder regexed = new StringBuilder(markdown.replaceAll("((?<=[\\s])|^)/[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com$0)").replaceAll("((?<=[\\s])|^)[rRuU]/[\\w-]+/{0,1}", "[$0](https://www.reddit.com/$0)")); int startIndex = 0; -- cgit v1.2.3