telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.23k stars 5.2k forks source link

Cannot create a link for 2+ words messages #27962

Closed aNNiMON closed 5 months ago

aNNiMON commented 5 months ago

Steps to reproduce

  1. Type a text containing 2+ words, test1 test2
  2. Ctrl+A
  3. Ctrl+K
  4. In URL paste any valid URL, https://github.com
  5. Press Create button

Expected behaviour

The link is created for the whole selected message

Actual behaviour

The link is created only for the first word

Operating system

Windows 11

Version of Telegram Desktop

5.0.2

Installation source

Static binary from official website

taha-ghadirian commented 5 months ago

I can confirm this issue on Arch Linux, 5.0.2 installed from static binaries. But can't reproduce it on windows 10, 5.0.2 installed from windows store.

Newliex commented 5 months ago

Telegram? we can say buygram Telegram doesn't value the desktop version for a long time :(

aNNiMON commented 5 months ago

@Aokromes this happens not only on Linux.

https://github.com/telegramdesktop/tdesktop/assets/1321838/79aa60d1-c92b-4e13-b723-ae0cd48b9335

alirezakamranian commented 5 months ago

Thats true for me too (I using telegram desktop v 5.0.2)

hairycactus commented 5 months ago

@taha-ghadirian: But can't reproduce it on windows 10, 5.0.2 installed from windows store.

I am able to always reproduce the bug in:

Specifically, Telegram v5.0.2 fails to create a hyperlink from more than 1 word when all of the below conditions are met:

  1. All words selected for link creation occur in Line 1
  2. Words selected for link creation in Line 1 include the 1st word
  3. Line(s) before line containing linked text is/are empty
  4. If text is in Line 1: No empty space(s) preceding linked text

Screenshot:

TelegramDesktop5.0.2-BugLinkText-26May24a

The following 4 scenarios are OK, ie. can create hyperlink from more than 1 word -- as denoted by square-bracketed [Word1 Word2 ...] below.

Scenario 1:

Line1: Any Text (unlinked or linked)
Line2: [Word1 Word2]
Line3: [Word1 Word2 Word3]

Scenario 2:

Line1: Word1 [Word2 Word3]
Line2: [Word1 Word2 Word3]

Additional Remark for Scenario 2's Line 1:

If user proceeds to create another hyperlink using Word1 ...

Scenario 3:

Line1: <empty>
Line2: [Word1 Word2 Word3]

Scenario 4:

Line1: <At least 1 empty space> [Word1 Word2]

For Scenarios 3 & 4: When the message is sent, Telegram automatically removes the below (not sure if a bug or by intentional design), & the message with linked words displays correctly by "accident".

Therefore, Scenarios 3 & 4 can be used as workaround methods, if user wishes to create a hyperlink from more than 1 word, or more than 1 hyperlink in Line 1.

Screenshot:

TelegramDesktop5.0.2-BugLinkText-26May24b

Video Demo of Bug & Workarounds:

https://github.com/telegramdesktop/tdesktop/assets/9943769/29975128-4bc3-4203-a986-ee8856a50b8f

john-preston commented 5 months ago

This will be fixed in 5.0.3 version later today.