Commit 4a51e61
authored
feat: make <a> tags with no href or empty href not treated as links (#260)
<!-- 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
This PR is an alternative to other PR in here handling iOS crashes due
to `<a>` tag not having `href` attribute. While the other on e decides
to allow empty `hrefs` as proper links, Android has no such logic. We
discussed it a bit with @exploIF and are more eager to go the following
way;
- No `href` attribute or an empty one => `<a>` tag not treated as a a
link
## Test Plan
- Open iOS example app
- Input following html either into `Set input's value` field or into the
component's `defaultValue` prop in `App.tsx`;
```
<html>
<p><a href="xd.com">Test2xdd</a></p>
</html>
```
Should be nicely treated as a link. Now make the href empty or
completely remove the attribute from the tag. It should not be treated
as a link and a new html won't have an `<a>` tag in there anymore.
## Screenshots / Videos
--
## Compatibility
| OS | Implemented |
| ------- | :---------: |
| iOS | ✅ |
| Android | ✅ (already handled that way) |1 parent fe30050 commit 4a51e61
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
613 | 625 | | |
614 | 626 | | |
615 | | - | |
| 627 | + | |
616 | 628 | | |
617 | 629 | | |
618 | 630 | | |
| |||
657 | 669 | | |
658 | 670 | | |
659 | 671 | | |
660 | | - | |
| 672 | + | |
661 | 673 | | |
662 | 674 | | |
663 | 675 | | |
| |||
0 commit comments