aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml/docilealligator/infinityforreddit
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-01-08 05:36:30 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-01-08 05:36:30 +0000
commit05b8b73043cffed8dabe955c240f4c1ad5f1b51f (patch)
tree3f5ee5754b6e28b4981dc78cc4ae30ef5d893694 /app/src/main/java/ml/docilealligator/infinityforreddit
parent7e5edf92b14c90ac22de17810dc6ee3444e11f06 (diff)
downloadinfinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.tar
infinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.tar.gz
infinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.tar.bz2
infinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.tar.lz
infinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.tar.xz
infinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.tar.zst
infinity-for-reddit-05b8b73043cffed8dabe955c240f4c1ad5f1b51f.zip
Correctly shows Snudown's header.
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java3
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 16fc6b0e..d3140863 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java
@@ -40,8 +40,9 @@ 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("\\^{2,}", "^").replaceAll("#(?![# ])", "# "));
+ //Fix superscript
int startIndex = regexed.indexOf("^");
while (startIndex >= 0 && startIndex + 1 < regexed.length()) {
char currentChar = regexed.charAt(startIndex + 1);