[konsole] [Bug 458996] URL parsing broken when URLs are wrapped in single-quotes

bugzilla_noreply at kde.org bugzilla_noreply at kde.org
Sat Nov 5 10:11:01 GMT 2022


https://bugs.kde.org/show_bug.cgi?id=458996

--- Comment #1 from bastimeyer123 at gmail.com ---
Would it make sense adding a word boundary to the URL regex? According to the
email regex, you're doing exactly that:
https://invent.kde.org/utilities/konsole/-/blob/b733bd03fd8ec49257f0564552a0565d189b8ec6/src/filterHotSpots/UrlFilter.cpp#L82

If that doesn't makes sense for URLs because of the "arbitrary"
path/querystring/hash contents, would it instead make sense checking the
character before matching the URL and adding a backreference of that character
as a suffix? For ' and " (and ` ???) this would be simple. If you want to
support parenthesis and brackets (angled ones don't seem to be supported at
all), then the regex would be a bit more complex with if-conditions for the
backreferences.
https://invent.kde.org/utilities/konsole/-/blob/b733bd03fd8ec49257f0564552a0565d189b8ec6/src/filterHotSpots/UrlFilter.cpp#L46

Or could the regex maybe be simplified by matching the character before the URL
in a capture group as well as the URL itself and checking the last character of
the URL capture group in the application logic afterwards, so that you can deal
with the surrounding characters without having to bloat up the regex? That
would enable handling all kinds of surrounding characters for URL matches.

Either way, always having to remove the quotation mark from a URL copied from
konsole has become really tedious and annoying, so I'd really appreciate if
this could be fixed soon. Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list