summary refs log tree commit diff
path: root/src/Config.h
diff options
context:
space:
mode:
authorJoseph Donofry <rubberduckie3554@gmail.com>2019-05-01 09:53:40 -0400
committerGitHub <noreply@github.com>2019-05-01 09:53:40 -0400
commit3f2781af86ca80e9c5da8bde9a219cc028660f4c (patch)
tree14108fbe0e7e7c8bcb2406e714e07740104dc95b /src/Config.h
parentMerge pull request #58 from zapashcanon/sh (diff)
parentRaw string literals not allowed in MOC headers on OSX (diff)
downloadnheko-3f2781af86ca80e9c5da8bde9a219cc028660f4c.tar.xz
Merge pull request #60 from MonokelPinguin/remove-xml-parsing-of-messages
Simplify linkifyMessage.  Fixes #18.  Thanks @MonokelPinguin 
Diffstat (limited to 'src/Config.h')
-rw-r--r--src/Config.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Config.h b/src/Config.h

index bb99ca87..e1271452 100644 --- a/src/Config.h +++ b/src/Config.h
@@ -1,6 +1,6 @@ #pragma once -#include <QRegExp> +#include <QRegularExpression> #include <QString> // Non-theme app configuration. Layouts, fonts spacing etc. @@ -51,8 +51,11 @@ constexpr auto LABEL_BIG_SIZE_RATIO = 2; namespace strings { const QString url_html = "<a href=\"\\1\">\\1</a>"; -const QRegExp url_regex( - "((www\\.(?!\\.)|[a-z][a-z0-9+.-]*://)[^\\s<>'\"]+[^!,\\.\\s<>'\"\\]\\)\\:])"); +const QRegularExpression url_regex( + // match an URL, that is not quoted, i.e. + // vvvvvvv match quote via negative lookahead/lookbehind vvvvvv + // vvvv atomic match url -> fail if there is a " before or after vv + "(?<!\")(?>((www\\.(?!\\.)|[a-z][a-z0-9+.-]*://)[^\\s<>'\"]+[^!,\\.\\s<>'\"\\]\\)\\:]))(?!\")"); } // Window geometry.