diff --git a/android/src/main/java/com/expensify/livemarkdown/MarkdownTextWatcher.java b/android/src/main/java/com/expensify/livemarkdown/MarkdownTextWatcher.java index 9391d334..23b215a2 100644 --- a/android/src/main/java/com/expensify/livemarkdown/MarkdownTextWatcher.java +++ b/android/src/main/java/com/expensify/livemarkdown/MarkdownTextWatcher.java @@ -9,8 +9,6 @@ public class MarkdownTextWatcher implements TextWatcher { private final MarkdownUtils mMarkdownUtils; - private boolean mShouldSkip = false; - public MarkdownTextWatcher(@NonNull MarkdownUtils markdownUtils) { mMarkdownUtils = markdownUtils; } @@ -22,17 +20,13 @@ public void beforeTextChanged(CharSequence s, int start, int count, int after) { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - if (mShouldSkip) { - return; - } - if (s instanceof SpannableStringBuilder) { - mMarkdownUtils.applyMarkdownFormatting((SpannableStringBuilder) s); - mShouldSkip = true; - } + } @Override public void afterTextChanged(Editable editable) { - mShouldSkip = false; + if (editable instanceof SpannableStringBuilder) { + mMarkdownUtils.applyMarkdownFormatting((SpannableStringBuilder) editable); + } } }