Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links with anchor is an URL but pointing to a different URL #277

Closed
4 tasks done
AkesiSeli opened this issue Jan 19, 2025 · 3 comments · Fixed by #292 or #313
Closed
4 tasks done

Links with anchor is an URL but pointing to a different URL #277

AkesiSeli opened this issue Jan 19, 2025 · 3 comments · Fixed by #292 or #313
Assignees

Comments

@AkesiSeli
Copy link

About the issue

If a link anchor is an URL itself but the link actual URL is pointing elsewhere, when clicked the anchor address is opened instead of the actual link URL.

E.g. if I modify the sample text by adding the following line:

This is a paragraph with a tricky link [https://www.google.com](https://www.jetbrains.com/).

and I tap on the link, https://www.google.com gets opened. Instead, the expected behaviour should be to open https://www.jetbrains.com/.

Details

Version used: 0.30.0

Checklist

@mikepenz
Copy link
Owner

mikepenz commented Feb 1, 2025

Thank you very much for the report. It's going to be fixed in the next beta

@mikepenz mikepenz self-assigned this Feb 1, 2025
@florianloewen
Copy link

Hey @mikepenz, this issue seems to still persist in v0.31.0-b04.

Markdown links are not behaving as expected.

The following Markdown inside the app sample incorrectly opens Google instead of JetBrains.

This is a paragraph with a link: [https://www.google.com](https://www.jetbrains.com/).

More relevant to my case:

This is a paragraph with a link: [www.jetbrains.com](https://www.jetbrains.com/).

results in the following error on Android:

Could not open the provided url: www.jetbrains.com // Can't open www.jetbrains.com.

since the wrong link gets parsed.

Thanks for all the work you are putting into this library!

mikepenz added a commit that referenced this issue Feb 9, 2025
…otherwise the second link overlaps the primary link causing issues

  - FIX #277
@mikepenz
Copy link
Owner

mikepenz commented Feb 9, 2025

Thanks for reporting it once more. When going to the new compose 1.7 withLink annotation, it caused issues one more given the parser parses the link text within the link as an AUTOLINK, resulting in double linking of the same link :D

will have it fixed in the next one by removing the AUTOLINK if we are already having it as link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants