Commit 6996dfd
authored
fix: handle style conflicts during automatic links detection (#257)
# Summary
Fixes: #256
Previously, links that were automatically detected from typed text could
still receive link styles even in areas where link styling should be
restricted (e.g. inside a code block).
This PR fixes that, making the behavior consistent with manual link
application:
- Adds a new helper function `detectLinkConflicts` that checks whether
the selected range contains blocking or conflicting styles.
- Updates `afterTextChangedLinks` to skip applying auto-detected links
if any conflicts are detected.
## Test Plan
1. Go to Example app
2. Create codeblock
3. Type example.com inside codeblock
## Screenshots / Videos
https://github.com/user-attachments/assets/d1e66dec-527e-4bd5-adce-e1db2f2867ba
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ❌ |
| Android | ✅ |1 parent 2f7feef commit 6996dfd
1 file changed
Lines changed: 18 additions & 2 deletions
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
107 | 123 | | |
108 | 124 | | |
109 | | - | |
| 125 | + | |
| 126 | + | |
110 | 127 | | |
111 | 128 | | |
112 | 129 | | |
113 | 130 | | |
114 | 131 | | |
115 | | - | |
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
| |||
0 commit comments