Fix URL regex 62/head
authorExpress50 <press.ex50@gmail.com>
Sun, 9 Mar 2014 17:42:01 +0000 (13:42 -0400)
committerExpress50 <press.ex50@gmail.com>
Sun, 9 Mar 2014 17:42:01 +0000 (13:42 -0400)
Removes unwise characters from URL regex. These characters should be percent escaped according to RFC 2396.

Fixes #1243

src/uisupport/clickable.cpp

index 7acd8e2..3b32f26 100644 (file)
@@ -55,7 +55,7 @@ ClickableList ClickableList::fromString(const QString &str)
     // For matching URLs
     static QString scheme("(?:(?:mailto:|(?:[+.-]?\\w)+://)|www(?=\\.\\S+\\.))");
     static QString authority("(?:(?:[,.;@:]?[-\\w]+)+\\.?|\\[[0-9a-f:.]+\\])(?::\\d+)?");
     // For matching URLs
     static QString scheme("(?:(?:mailto:|(?:[+.-]?\\w)+://)|www(?=\\.\\S+\\.))");
     static QString authority("(?:(?:[,.;@:]?[-\\w]+)+\\.?|\\[[0-9a-f:.]+\\])(?::\\d+)?");
-    static QString urlChars("(?:[,.;:]*[\\w~@/?&=+$()!%#*{}\\[\\]\\|'^-])");
+    static QString urlChars("(?:[,.;:]*[\\w~@/?&=+$()!%#*-])");
     static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)");
 
     static QRegExp regExp[] = {
     static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)");
 
     static QRegExp regExp[] = {