Commit d3fc7f1
committed
fix(android): correct insertion boundary in FormattingStore and add serializer bounds check
Change adjustForEdit to shift ranges when editLocation == range.start
(using >= instead of >), matching iOS behavior. Without this, typing
at the start of a formatted range fails to shift it, causing the
inserted character to incorrectly inherit the style.
Add bounds clamping in MarkdownSerializer to prevent
StringIndexOutOfBoundsException if the formatting store ever contains
ranges that exceed the text length.
Made-with: Cursor1 parent fa81a11 commit d3fc7f1
2 files changed
Lines changed: 5 additions & 3 deletions
File tree
- android/src/main/java/com/swmansion/enriched/markdown/input/formatting
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
0 commit comments