Links containing %23 are visually rendered as different links
samueltardieu opened this issue · 0 comments
Telega Setup
OS: NixOS 24.11 (Vicuna)
Emacs: GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw3d scroll bars)
Features: svg webp ffmpeg
Telega: telega v0.8.293 (TDLib v1.8.29-12c1689) (telega-server v0.8.2 [docker])
Current Behavior
Links are unhexified before being rendered. While this is fine for most codepoints, "%23" is displayed as "#" which has a different semantics.
For example, "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%231079375" will be displayed as "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=#1079375" which is interpreted by web browsers as "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=" with anchor "1079375".
While Telega is able to open (RET) or copy (c) the link, it renders it with visually incompatible semantics. Copying the Telega conversation into a mail, or acting on the link with embark will lead to the wrong URL being used.
Steps to Reproduce
- Drop a link such as "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%231079375" into a Telega chat.
- See it displayed as "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=#1079375"
- Copy the displayed text into your browser and see it fail
Possible Solution
If the link target and the link text are identical (or the link text is omitted, I didn't check the tdlib api), "%23" should be exempt from unhexification.