Skip to content

fix: handle style conflicts during automatic links detection - #257

Merged
exploIF merged 6 commits into
software-mansion:mainfrom
kacperzolkiewski:fix-automatic-links-conflicts
Nov 18, 2025
Merged

exploIF merged 6 commits into
software-mansion:mainfrom
kacperzolkiewski:fix-automatic-links-conflicts

Conversation

@kacperzolkiewski

Copy link
Copy Markdown
Collaborator

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

Nagranie.z.ekranu.2025-11-17.o.15.08.56.mov

Compatibility

OS Implemented
iOS
Android

@exploIF exploIF left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks really good 🚀
Just two minor comments

Comment thread android/src/main/java/com/swmansion/enriched/styles/ParametrizedStyles.kt Outdated
Comment thread android/src/main/java/com/swmansion/enriched/styles/ParametrizedStyles.kt Outdated
@exploIF
exploIF merged commit 6996dfd into software-mansion:main Nov 18, 2025
5 checks passed
pkaramon added a commit that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] link styles applied in codeblock

2 participants