From 0887b534269e17678fda91fee0bf65ad7249170d Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 8 Jan 2021 13:59:27 +0800 Subject: Fix regex for supporting snudown's header. --- .../main/java/ml/docilealligator/infinityforreddit/utils/Utils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/src/main/java') 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 d3140863..b71d3d0f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java @@ -40,7 +40,8 @@ public class Utils { 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)") - .replaceAll("\\^{2,}", "^").replaceAll("#(?![# ])", "# ")); + .replaceAll("\\^{2,}", "^") + .replaceAll("(?