From 8df80afa79ce6768d295051c4962e6b8fb629652 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Feb 2026 07:54:47 +0530 Subject: [PATCH] URL detection: Allow trailing asterisks in URLs Fixes #9543 --- docs/changelog.rst | 2 ++ kitty/unicode-data.h | 4 +++- kitty_tests/screen.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ad295169c..f4bac8049 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -238,6 +238,8 @@ Detailed list of changes - macOS: Workaround for yet another Tahoe bug causing rendering to fail (:pull:`9520`) +- URL detection: Allow trailing asterisks in URLs (:iss:`9543`) + 0.45.0 [2025-12-24] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/unicode-data.h b/kitty/unicode-data.h index ac6f9eff3..fcbdf9587 100644 --- a/kitty/unicode-data.h +++ b/kitty/unicode-data.h @@ -58,7 +58,9 @@ is_url_char(uint32_t ch) { static inline bool can_strip_from_end_of_url(uint32_t ch) { // remove trailing punctuation - return (char_props_for(ch).is_punctuation && ch != '/' && ch != '&' && ch != '-' && ch != ')' && ch != ']' && ch != '}'); + return (char_props_for(ch).is_punctuation && + ch != '/' && ch != '&' && ch != '-' && ch != ')' && ch != ']' && ch != '}' && ch != '*' + ); } static inline bool diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index 0783047be..556268057 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -1711,3 +1711,4 @@ def detect_url(self, scale=1): t('http://[::1]:8080/x', after='[') # ] t('http://[::1]:8080/x]y34', expected='http://[::1]:8080/x') t('https://wraps-by-one-char.com[]/x', after='[') # ] + t('https://t.me/#1_*_*_*_*')