diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-20 13:52:13 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-20 14:05:10 +0200 |
commit | 0ad74590d4b7d91189a08d2278aaa6093d0a7e22 (patch) | |
tree | 86b4678bfb1d27d1346ef0bdfa419bce8fba4721 /src/Config.h | |
parent | Merge pull request #1121 from MayeulC/32bit (diff) | |
download | nheko-0ad74590d4b7d91189a08d2278aaa6093d0a7e22.tar.xz |
Fix matrix.to link escaping
Properly escapes in replies and with unmatched []. fixes #854
Diffstat (limited to 'src/Config.h')
-rw-r--r-- | src/Config.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Config.h b/src/Config.h index 72521f20..5a742337 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,9 +30,7 @@ const QRegularExpression url_regex( // vvvv atomic match url -> fail if there is a " before or after vvv QStringLiteral( R"((?<!["'])(?>((www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,\.\s<>'"\]\)\:]))(?!["']))")); -// match any markdown matrix.to link. Capture group 1 is the link name, group 2 is the target. -static const QRegularExpression - matrixToMarkdownLink(QStringLiteral(R"(\[(.*?)(?<!\\)\]\((https://matrix.to/#/.*?\)))")); +// A matrix link to be converted back to markdown static const QRegularExpression matrixToLink(QStringLiteral(R"(<a href=\"(https://matrix.to/#/.*?)\">(.*?)</a>)")); } |