Bug 445154

Summary: hyperlink truncated for an email address with long TLD
Product: [Applications] konversation Reporter: Jonathan Wakely <zilla>
Component: ircviewAssignee: argonel <argonel>
Status: REPORTED ---    
Severity: minor CC: konversation-devel
Priority: NOR    
Version First Reported In: 1.8.21041   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jonathan Wakely 2021-11-08 11:07:25 UTC
SUMMARY

An email address such as test@foo.invalid is not displayed correctly, the hyperlink doesn't include the final 'd'

That email address isn't valid, but the same thing happens for any address at foo.website or foo.computer or foo.academy or any other TLD longer than 6 characters.

STEPS TO REPRODUCE
1.  send an IRC message containing foo@test.abcdefghi
2. look at the hyperlink konversation creates
3. 

OBSERVED RESULT

Only "foo@test.abcdef" is hyperlinked.

EXPECTED RESULT

The whole email address should be a hyperlink.

SOFTWARE/OS VERSIONS
Konversation: 1.8.21041
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

This seems to be a bug in the urlPattern regex:
https://github.com/KDE/konversation/blob/9288fab598d84ceaf4ff1d5a782adf6882e2ec57/src/common.h#L24

The relevant part for email addresses seems to be @[a-z0-9.\\-]+[.][a-z]{1,5}[^...] which assumes a maximum length of 5+1
Maybe changing the {1,5} to simply + would work.