software-mansion / software-mansion/react-native-enriched-html
onLinkDetected invalid behavior when splitting a link over multiple lines
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.4k
- Forks
- 66
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 11
Description
Describe the bug
If we create a link, and then split it across many lines by pressing enter the html output shows we have a couple of seperate link elements. But:
- on Android
onLinkDetectedtreats those multiple links as a single one - on iOS we treat those links as seperate but the
textattribute is invalid, it returns the link text before splitting it.
To Reproduce
Steps to reproduce the behavior:
- In
useEditorState.tsset
const handleLinkDetected = (state: CurrentLinkState) => {
console.log('link detected', state);
setCurrentLink(state);
};
- Launch example app
- Add an example link
- Repeatedly press enter in the middle of the link to split it across multiple lines.
- On Android
onLinkDetectedtreats those multiple links as a single one. On iOS thetextattribute is wrong, it tells us the link text before splitting.
Expected behavior
On Android onLinkDetected shouldn't treat those multiple links as one. On iOS text should return substrings in the video example H, 'e', l, l, 'o`
Screenshots
https://github.com/user-attachments/assets/27125c21-6aee-4529-bd93-840c0ba35990
Device (please complete the following information):
- Device: iPhone 17, Pixel 9
- OS: iOS 26.2, Android 16
- Version -, API 36 "Baklava"
Additional context
Add any other context about the problem here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the example app and reproduce the behavior using the handleLinkDetected code in useEditorState.ts. Compare onLinkDetected results on Android and iOS when a link is split across lines, then verify that Android reports separate links and iOS returns the text substring for each resulting link element.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100