aboutsummaryrefslogtreecommitdiff
path: root/lib/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.cpp')
-rw-r--r--lib/util.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/util.cpp b/lib/util.cpp
index 883db2ea..4e17d2f9 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -57,18 +57,19 @@ void QMatrixClient::linkifyUrls(QString& htmlEscapedText)
// NOTE: htmlEscapedText is already HTML-escaped! No literal <,>,&,"
htmlEscapedText.replace(EmailAddressRegExp,
- QStringLiteral(R"(<a href="mailto:\2">\1\2</a>)"));
+ QStringLiteral(R"(<a href="mailto:\2">\1\2</a>)"));
htmlEscapedText.replace(FullUrlRegExp,
- QStringLiteral(R"(<a href="\1">\1</a>)"));
+ QStringLiteral(R"(<a href="\1">\1</a>)"));
htmlEscapedText.replace(MxIdRegExp,
- QStringLiteral(R"(\1<a href="https://matrix.to/#/\2">\2</a>)"));
+ QStringLiteral(R"(\1<a href="https://matrix.to/#/\2">\2</a>)"));
}
QString QMatrixClient::sanitized(const QString& plainText)
{
auto text = plainText;
- text.remove(QChar(0x202e));
- text.remove(QChar(0x202d));
+ text.remove(QChar(0x202e)); // RLO
+ text.remove(QChar(0x202d)); // LRO
+ text.remove(QChar(0xfffc)); // Object replacement character
return text;
}