From a18bfebf1a54f5a3cc1743b2b8c712832de91375 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 27 Mar 2009 00:07:21 +0100 Subject: [PATCH] Allow arbitrary protocols for URL detection Rather than hardcoding a selection of protocols, we now allow all of the form \w+:// (plus mailto:) - this should cover all that make sense. See also bug #641. --- src/qtui/chatitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index dd23c5cb..9c84249c 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -418,7 +418,7 @@ QList ContentsChatItem::findClickables() const { static QRegExp regExp[] = { // URL // QRegExp(QString("((?:https?://|s?ftp://|irc://|mailto:|www\\.)%1+|%1+\\.[a-z]{2,4}(?:?=/%1+|\\b))%2").arg(urlChars, urlEnd)), - QRegExp(QString("((?:(?:https?://|s?ftp://|irc://|gopher://|mailto:)|www)%1+)%2").arg(urlChars, urlEnd), Qt::CaseInsensitive), + QRegExp(QString("((?:(?:mailto:|\\w+://)|www)%1+)%2").arg(urlChars, urlEnd), Qt::CaseInsensitive), // Channel name // We don't match for channel names starting with + or &, because that gives us a lot of false positives. -- 2.20.1