GNOME Bugzilla – Bug 570898
incomplete email address/mailto url matching
Last modified: 2021-06-10 19:53:38 UTC
Please describe the problem: None of the following addresses which are all valid and can be found in RFC 3696, section 4.3, are recognized properly (recognized part inside parenthesis). user+mailbox@example.com (mailbox@example.com) mailto:user%2Bmailbox@example.com (2Bmailbox@example.com) customer/department=shipping@example.com (shipping@example.com) mailto:customer%2Fdepartment=shipping@example.com (shipping@example.com) $A12345@example.com (A12345@example.com) mailto:$A12345@example.com (A12345@example.com) !def!xyz%abc@example.com (abc@example.com) mailto:!def!xyz%25abc@example.com (25abc@example.com) _somename@example.com (somename@example.com) mailto:_somename@example.com (somename@example.com) Moreover, even if the addresses would be recognized, opening one of them would cause g-t to prefix it with "mailto:" instead of prefixing it AND encoding it. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
And we see that Bugzilla is not perfect either, but does a slightly better job.
One if these days, the URL matcher in gnome-terminal is going to be come self-aware and we'll all be done for :/
Created attachment 128236 [details] [review] regexes reimplementation I took the RFC3986 which contains the generic URI grammar and implemented it (I didn't find such a regex in GNOME libraries). It is a bit larger than it was before, but no one will complain about an URL not being recognized. I think g-t shouldn't care about the kind of URL (http, h323, mailto, or whatever), it should just propose to open/copy them with GNOME which will handle it the way it is configured for. Beside this, I took the RFC3696 and implemented something for email addresses. For now, all of the above mailto URL's and addresses are properly recognized. And BTW, it fixes #448044 and #546628.
Created attachment 128258 [details] [review] regexes reimplementation (slightly improved) * slightly improved performance regarding last version * useless rules commented * regressions fixed regarding www addresses
Comment on attachment 128236 [details] [review] regexes reimplementation obsolete
src/terminal-util.c What was the point of switching from g_strdup_printf() to g_string_new + g_string_append ? Apart from that, looks good.
All fixed by the regex rewrite from bug 756038.
Reopening, the big regex rewrite did _not_ fix these special cases mentioned in comment 0.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-terminal/-/issues/6784.