@expensify/react-native-live-markdown 0.1.139 → 0.1.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,8 +9,6 @@ import androidx.annotation.NonNull;
9
9
  public class MarkdownTextWatcher implements TextWatcher {
10
10
  private final MarkdownUtils mMarkdownUtils;
11
11
 
12
- private boolean mShouldSkip = false;
13
-
14
12
  public MarkdownTextWatcher(@NonNull MarkdownUtils markdownUtils) {
15
13
  mMarkdownUtils = markdownUtils;
16
14
  }
@@ -22,17 +20,13 @@ public class MarkdownTextWatcher implements TextWatcher {
22
20
 
23
21
  @Override
24
22
  public void onTextChanged(CharSequence s, int start, int before, int count) {
25
- if (mShouldSkip) {
26
- return;
27
- }
28
- if (s instanceof SpannableStringBuilder) {
29
- mMarkdownUtils.applyMarkdownFormatting((SpannableStringBuilder) s);
30
- mShouldSkip = true;
31
- }
23
+
32
24
  }
33
25
 
34
26
  @Override
35
27
  public void afterTextChanged(Editable editable) {
36
- mShouldSkip = false;
28
+ if (editable instanceof SpannableStringBuilder) {
29
+ mMarkdownUtils.applyMarkdownFormatting((SpannableStringBuilder) editable);
30
+ }
37
31
  }
38
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expensify/react-native-live-markdown",
3
- "version": "0.1.139",
3
+ "version": "0.1.140",
4
4
  "description": "Drop-in replacement for React Native's TextInput component with Markdown formatting.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",