From 73ddafdfccc3f6bb69df13b06a2b7b68e9f6dce8 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 22 Feb 2021 23:44:35 +0800 Subject: Try to fix superscript rendering. --- .../java/ml/docilealligator/infinityforreddit/utils/Utils.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/src') 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) { -- cgit v1.2.3