diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-02-22 15:44:35 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-02-22 15:44:35 +0000 |
commit | 73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8 (patch) | |
tree | e0f9b55763ad1eaedb550b5b59d85170a24c72ae /app/src/main/java | |
parent | fea59bc66df35664029f3dca14de4b444ba6ef9e (diff) | |
download | infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.tar infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.tar.gz infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.tar.bz2 infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.tar.lz infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.tar.xz infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.tar.zst infinity-for-reddit-73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8.zip |
Try to fix superscript rendering.
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java | 10 |
1 files changed, 7 insertions, 3 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 13ae3a79..a43b0ffc 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java @@ -99,9 +99,13 @@ public class Utils { } } else if (currentChar == ' ' || currentChar == '\n') { if (newestCaretIndex >= 0) { - regexed.insert(i, '^'); - newestCaretIndex = -1; - i++; + if (i != newestCaretIndex + 1) { + regexed.insert(i, '^'); + newestCaretIndex = -1; + i++; + } else { + newestCaretIndex = -1; + } } } else if (currentChar == '(') { if (newestCaretIndex >= 0 && i == newestCaretIndex + 1) { |