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

URLs in formatted text messages aren't linkified #1079

Closed
ara4n opened this issue Aug 17, 2023 · 1 comment · Fixed by #1102
Closed

URLs in formatted text messages aren't linkified #1079

ara4n opened this issue Aug 17, 2023 · 1 comment · Fixed by #1102
Assignees
Labels
A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@ara4n
Copy link
Member

ara4n commented Aug 17, 2023

Steps to reproduce

  1. Receive a text message with a plain URL in it - e.g.
Screenshot 2023-08-17 at 22 48 33

For whatever reason, the sender's client didn't explicitly hyperlink it in the HTML:

{
  "content": {
    "body": "https://github.com/vector-im/element-x-android/pull/1055#issuecomment-1675033424",
    "format": "org.matrix.custom.html",
    "formatted_body": "https://github.com/vector-im/element-x-android/pull/1055#issuecomment-1675033424",
    "msgtype": "m.text"
  },
  "origin_server_ts": 1692006809060,
  "room_id": "!aCvOWKNDeXXpPgquKq:matrix.org",
  "sender": "@onestacked:onestacked.duckdns.org",
  "type": "m.room.message",
  "unsigned": {},
  "event_id": "$0_vVJyrFYvbYQww67TO7fhjfenSwXcdholTtyXGYmow",
  "user_id": "@onestacked:onestacked.duckdns.org"
}

Outcome

What did you expect?

Things which look like URLs should be hyperlinked by the receiving client automatically, otherwise it's just frustrating for the user who wonders why they can't click on them.

What happened instead?

The url isn't linkified.

Your phone model

S10

Operating system version

12

Application version and app store

0.1.2 (40001020) playstore

Homeserver

No response

Will you send logs?

No

Are you willing to provide a PR?

No

@ara4n ara4n added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Aug 17, 2023
@jmartinesp
Copy link
Member

jmartinesp commented Aug 18, 2023

I see, the issue comes from the formatted_body containing just the URL and us parsing the HTML as is. We do have a clickable text view with linkify for plain text, and it would also appear as a link if it was an actual <a> link in the HTML, but we missed this particular case.

image

The message above is one sent as plain text and linkified, the one below was sent using the RTE with just the URL.

@jmartinesp jmartinesp added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Occasional Affects or can be seen by some users regularly or most users rarely A-Timeline labels Aug 18, 2023
@jmartinesp jmartinesp changed the title URLs in text messages aren't linkified URLs in formatted text messages aren't linkified Aug 18, 2023
@jmartinesp jmartinesp self-assigned this Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Timeline O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants