Bug 445154 - hyperlink truncated for an email address with long TLD
Summary: hyperlink truncated for an email address with long TLD
Status: REPORTED
Alias: None
Product: konversation
Classification: Applications
Component: ircview (show other bugs)
Version: 1.8.21041
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: argonel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-08 11:07 UTC by Jonathan Wakely
Modified: 2021-11-08 11:07 UTC (History)
1 user (show)

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 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.