Bug 472274 - omit trailing punctuation when highlighting/invoking urls
Summary: omit trailing punctuation when highlighting/invoking urls
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 22.12.3
Platform: Debian unstable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-15 10:44 UTC by Oswald Buddenhagen
Modified: 2024-07-22 19:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oswald Buddenhagen 2023-07-15 10:44:00 UTC
in flowed text (e.g., emails) it's rather common for urls to be followed by a comma or full stop, sometimes a colon or semicolon. it's unhelpful when this punctuation is considered part of the url, as it typically invalidates it. therefore i think it would make sense to strip trailing characters with a clear punctuation function. (notably, colons are already treated specially.)

somewhat related to bug 399291.
Comment 1 Bug Janitor Service 2023-12-01 07:33:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/934
Comment 2 Méven 2024-07-22 19:55:55 UTC
Git commit 02ba8cefc763f841e523c77069860253599b2dc0 by Méven Car, on behalf of Wendi Gan.
Committed on 22/07/2024 at 12:05.
Pushed by meven into branch 'master'.

url filter: remove trailing non-URL characters

Adjusted UrlFilter::newHotSpot to strip non-URL trailing characters (e.g., commas, dots) using regex "[',.:;]+$". This ensures correct URL parsing without trailing punctuation.

Test case: 'https://example.com.' should exclude the trailing dot.
Related: bug 473285

M  +16   -10   src/filterHotSpots/UrlFilter.cpp

https://invent.kde.org/utilities/konsole/-/commit/02ba8cefc763f841e523c77069860253599b2dc0