Commit 89ca463
authored
fix: iOS links (#272)
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect -->
# Summary
Firstly, it turns out that something in the internal implementation of
`attribute:atIndex:longestEffectiveRange:inRange` has been changed and
if no attribute has been found, longest effective range is set to whole
range we are searching in. This resulted in links wrongly returning that
their range is whole input and it had implications in fonts and
foreground colors randomly breaking when applying links.
Secondly, improved detecting links. The detection made after updating an
automatic link didn't take recently emitted link into consideration and
ran the event even if the automatic link wasn't updated - resulting in a
double emit. The text when applying link was also double emitted because
`LinkStyle's` `addLink` redundantly called `anyTextMayHaveBeenModified`
## Test Plan
- To check the first issue, apply a manual link via link editor while
having some inline code and blockquotes in the input. See that their
styling is stil intact.
- For the second one just add an automatic link and see no double
emitting in console.
## Screenshots / Videos
--
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ✅ |
| Android | ❌(doesn't apply) |1 parent 8fc6472 commit 89ca463
2 files changed
Lines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | 714 | | |
718 | 715 | | |
719 | 716 | | |
| |||
812 | 809 | | |
813 | 810 | | |
814 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
815 | 819 | | |
816 | 820 | | |
817 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | 170 | | |
172 | 171 | | |
173 | 172 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
227 | | - | |
| 226 | + | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
233 | | - | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
240 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| |||
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
| 353 | + | |
| 354 | + | |
352 | 355 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
0 commit comments