recognise IPv6 literals in URLs as per RFC 2732
authorDaniel Albers <daniel@lbers.com>
Sun, 31 Jan 2010 15:37:17 +0000 (16:37 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 31 Jan 2010 19:26:06 +0000 (20:26 +0100)
src/uisupport/clickable.cpp

index e875bad..16fc790 100644 (file)
@@ -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|$)");