diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java | 3 |
1 files changed, 2 insertions, 1 deletions
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("(?<![\\[\\(])#(?![# ])(?![\\w\\s]*[\\]\\)])", "# ")); //Fix superscript int startIndex = regexed.indexOf("^"); |