aboutsummaryrefslogtreecommitdiff
path: root/lib/util.cpp
diff options
context:
space:
mode:
authorHubert Chathi <uhoreg@debian.org>2021-10-16 00:03:36 -0400
committerHubert Chathi <uhoreg@debian.org>2021-10-16 00:03:36 -0400
commit5a8c406749160a01865cbac8b4591a8e3c31e4c6 (patch)
tree0bafb35b381954589f90fccfa3e5ff34e871c494 /lib/util.cpp
parenteb2f105aea98f640e2f95854983bb06ade95bb3e (diff)
parent0a342369406e2d259ce20e5fa6d53ac271cbf3c2 (diff)
downloadlibquotient-5a8c406749160a01865cbac8b4591a8e3c31e4c6.tar.gz
libquotient-5a8c406749160a01865cbac8b4591a8e3c31e4c6.zip
Update to upstream version 0.6.11
Diffstat (limited to 'lib/util.cpp')
-rw-r--r--lib/util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/util.cpp b/lib/util.cpp
index 875d7522..cf5e81a3 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -47,7 +47,7 @@ void Quotient::linkifyUrls(QString& htmlEscapedText)
// comma or dot
static const QRegularExpression FullUrlRegExp(
QStringLiteral(
- R"(\b((www\.(?!\.)(?!(\w|\.|-)+@)|(https?|ftp|magnet|matrix):(//)?)(&(?![lg]t;)|[^&\s<>'"])+(&(?![lg]t;)|[^&!,.\s<>'"\]):])))"),
+ R"(\b((www\.(?!\.)(?!(\w|\.|-)+@)|(https?|ftp):(//)?\w|(magnet|matrix):)(&(?![lg]t;)|[^&\s<>'"])+(&(?![lg]t;)|[^&!,.\s<>'"\]):])))"),
RegExpOptions);
// email address:
// [word chars, dots or dashes]@[word chars, dots or dashes].[word chars]
@@ -58,7 +58,7 @@ void Quotient::linkifyUrls(QString& htmlEscapedText)
// https://matrix.org/docs/spec/appendices.html#identifier-grammar
static const QRegularExpression MxIdRegExp(
QStringLiteral(
- R"((^|[^<>/])([!#@][-a-z0-9_=#/.]{1,252}:(?:\w|\.|-)+\.\w+(?::\d{1,5})?))"),
+ R"((^|[][[:space:](){}`'";])([!#@][-a-z0-9_=#/.]{1,252}:\w(?:\w|\.|-)*\.\w+(?::\d{1,5})?))"),
RegExpOptions);
Q_ASSERT(FullUrlRegExp.isValid() && EmailAddressRegExp.isValid()
&& MxIdRegExp.isValid());