Fix missing character before a Matrix ID
When you send messages like "a @blankeclair:catgirl.cloud b" or "]#rainversewiki:catgirl.cloud", they would be rendered like "a@blankeclair:catgirl.cloud b" and "#rainversewiki:catgirl.cloud" respectively. This commit fixes that by not matching the character before the MXID in the regex.
This commit is contained in:
committed by
Tobias Fella
parent
f7533a454c
commit
30e24069bc
@@ -626,7 +626,7 @@ QString TextHandler::linkifyUrls(QString stringIn)
|
||||
int skip = 0;
|
||||
if (match.captured(0).size() > 0) {
|
||||
if (stringIn.left(index).count(QStringLiteral("<code>")) == stringIn.left(index).count(QStringLiteral("</code>"))) {
|
||||
auto replacement = QStringLiteral("<a href=\"https://matrix.to/#/%1\">%1</a>").arg(match.captured(2));
|
||||
auto replacement = QStringLiteral("<a href=\"https://matrix.to/#/%1\">%1</a>").arg(match.captured(1));
|
||||
stringIn = stringIn.replace(index, match.captured(0).size(), replacement);
|
||||
} else {
|
||||
skip = match.captured().length();
|
||||
|
||||
Reference in New Issue
Block a user