From f263d0ac55efd087eafda94a8eb061ca1d649f34 Mon Sep 17 00:00:00 2001 From: Daniel Albers Date: Sun, 31 Jan 2010 16:37:17 +0100 Subject: [PATCH] recognise IPv6 literals in URLs as per RFC 2732 --- src/uisupport/clickable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uisupport/clickable.cpp b/src/uisupport/clickable.cpp index e875bad1..16fc790f 100644 --- a/src/uisupport/clickable.cpp +++ b/src/uisupport/clickable.cpp @@ -51,7 +51,7 @@ void Clickable::activate(NetworkId networkId, const QString &text) const { ClickableList ClickableList::fromString(const QString &str) { // For matching URLs static QString scheme("(?:(?:mailto:|(?:[+.-]?\\w)+://)|www(?=\\.\\S+\\.))"); - static QString authority("(?:[,.;@:]?[-\\w]+)+(?::\\d+)?"); + static QString authority("(?:(?:[,.;@:]?[-\\w]+)+|\\[[0-9a-f:.]+\\])(?::\\d+)?"); static QString urlChars("(?:[,.;:]*[\\w~@/?&=+$()!%#*{}\\[\\]\\|'^-])"); static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)"); -- 2.20.1