Adjust URL RegEx to allow for domain names ending with a dot.
authorHendrik Leppkes <h.leppkes@gmail.com>
Fri, 12 Feb 2010 15:38:21 +0000 (16:38 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 14 Feb 2010 22:55:27 +0000 (23:55 +0100)
src/uisupport/clickable.cpp

index 16fc790..0674d0e 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+\\.))");
 ClickableList ClickableList::fromString(const QString &str) {
   // For matching URLs
   static QString scheme("(?:(?:mailto:|(?:[+.-]?\\w)+://)|www(?=\\.\\S+\\.))");
-  static QString authority("(?:(?:[,.;@:]?[-\\w]+)+|\\[[0-9a-f:.]+\\])(?::\\d+)?");
+  static QString authority("(?:(?:[,.;@:]?[-\\w]+)+\\.?|\\[[0-9a-f:.]+\\])(?::\\d+)?");
   static QString urlChars("(?:[,.;:]*[\\w~@/?&=+$()!%#*{}\\[\\]\\|'^-])");
   static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)");
 
   static QString urlChars("(?:[,.;:]*[\\w~@/?&=+$()!%#*{}\\[\\]\\|'^-])");
   static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)");