Commit 67c9cc0
authored
fix: iOS nested tags (#274)
<!-- 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
Turns out nested tags logic isn't perfect on iOS yet.
Adding a styling like this:
<img width="382" height="284" alt="image"
src="https://github.com/user-attachments/assets/04b96797-43d4-42c4-8ef0-f4ba98fa5f86"
/>
(bold and strikethrough, then only strikethrough, then again both of
them)
Results in an invalid html:
```
<html>
<p><b><s>Both</s></b><s>onlystrike<b>both</s></b></p>
</html>
```
The `s` tag should have been closed before another `b` tag and opened
again after it.
This PR fixes that situation, making sure all tags that were active
index ago and are still active on the index under consideration, if
inner to a newly opened tag, will be closed and re-opened.
## Test Plan
Try re-creating the text described in the Summary.
See that it produces a valid html now:
```
<html>
<p><b><s>Both</s></b><s>onlystrike</s><b><s>both</s></b></p>
</html>
```
## Screenshots / Videos
--
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ✅ |
| Android | doesn't apply |1 parent 0db5cfe commit 67c9cc0
1 file changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
187 | 206 | | |
188 | 207 | | |
189 | 208 | | |
| |||
193 | 212 | | |
194 | 213 | | |
195 | 214 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 215 | + | |
| 216 | + | |
199 | 217 | | |
200 | 218 | | |
201 | 219 | | |
| |||
0 commit comments