Skip to content

Commit

Permalink
Fix "setSpan ends beyond length" crash on Android (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw authored Jul 3, 2024
1 parent 62ddd26 commit 74fd81e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public void applyMarkdownFormatting(SpannableStringBuilder ssb) {
int length = range.getInt("length");
int depth = range.optInt("depth", 1);
int end = start + length;
if (length == 0 || end > input.length()) {
continue;
}
applyRange(ssb, type, start, end, depth);
}
} catch (JSONException e) {
Expand Down

0 comments on commit 74fd81e

Please sign in to comment.