Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
feat(chatfom): make magnet links clickable
Browse files Browse the repository at this point in the history
Add one more rergular expression that should match magnet links.
Unfortunately, magnet links may contain a lot of spaces, so
the message after the link may also be treated as a part of link.
  • Loading branch information
tvladyslav committed Jan 17, 2019
1 parent 51cf712 commit 5b1bc7e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/chatlog/textformatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static const QVector<QRegularExpression> URI_WORD_PATTERNS = {
QRegularExpression(QStringLiteral(R"((?<=^|\s)\S*(tox:[a-zA-Z\d]{76}))")),
QRegularExpression(QStringLiteral(R"((?<=^|\s)\S*(mailto:\S+@\S+\.\S+))")),
QRegularExpression(QStringLiteral(R"((?<=^|\s)\S*(tox:\S+@\S+))")),
QRegularExpression(QStringLiteral(R"((?<=^|\s)\S*(magnet:[?]((xt(.\d)?=urn:)|(mt=)|(kt=)|(tr=)|(dn=)|(xl=)|(xs=)|(as=)|(x.))[\S| ]+))")),
};


Expand Down

0 comments on commit 5b1bc7e

Please sign in to comment.