Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
a320fc6f
Verified
Commit
a320fc6f
authored
2 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
lint
parent
539db70f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4270
failed
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Config.h
+40
-34
40 additions, 34 deletions
src/Config.h
with
40 additions
and
34 deletions
src/Config.h
+
40
−
34
View file @
a320fc6f
...
...
@@ -25,39 +25,46 @@ constexpr auto LABEL_MEDIUM_SIZE_RATIO = 1.3;
namespace
strings
{
const
QString
url_html
=
QStringLiteral
(
"<a href=
\"\\
1
\"
>
\\
1</a>"
);
const
QRegularExpression
url_regex
(
const
QRegularExpression
url_regex
(
// match an unquoted URL
[](){
const
auto
general_unicode
=
QStringLiteral
(
R"((?:[^\x{0}-\x{7f}\p{Cc}\s\p{P}]|[\x{2010}\x{2011}\x{2012}\x{2013}\x{2014}\x{2015}]))"
),
protocol
=
QStringLiteral
(
R"((?:[Hh][Tt][Tt][Pp][Ss]?))"
),
unreserved_subdelims_colon
=
QStringLiteral
(
R"([a-zA-Z0-9\-._~!$&'()*+,;=:])"
),
pct_enc
=
QStringLiteral
(
R"((?:%[[:xdigit:]]{2}))"
),
userinfo
=
"(?:"
+
unreserved_subdelims_colon
+
"*(?:"
+
pct_enc
+
unreserved_subdelims_colon
+
"*)*)"
,
dec_octet
=
QStringLiteral
(
R"((?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))"
),
ipv4_addr
=
"(?:"
+
dec_octet
+
R"((?:\.)"
+
dec_octet
+
"){3})"
,
h16
=
QStringLiteral
(
R"((?:[[:xdigit:]]{1,4}))"
),
ls32
=
"(?:"
+
h16
+
":"
+
h16
+
"|"
+
ipv4_addr
+
")"
,
ipv6_addr
=
"(?:"
"(?:"
+
h16
+
":){6}"
+
ls32
+
"|"
"::(?:"
+
h16
+
":){5}"
+
ls32
+
"|"
+
h16
+
"?::(?:"
+
h16
+
":){4}"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,1})?::(?:"
+
h16
+
":){3}"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,2})?::(?:"
+
h16
+
":){2}"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,3})?::"
+
h16
+
":"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,4})?::"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,5})?::"
+
h16
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,6})?::"
")"
,
ipvfuture
=
R"((?:v[[:xdigit:]]+\.)"
+
unreserved_subdelims_colon
+
"+)"
,
ip_literal
=
R"((?:\[(?:)"
+
ipv6_addr
+
"|"
+
ipvfuture
+
R"()\]))"
,
host_alnum
=
"(?:[a-zA-Z0-9]|"
+
general_unicode
+
")"
,
host_label
=
"(?:"
+
host_alnum
+
"+(?:-+"
+
host_alnum
+
"+)*)"
,
hostname
=
"(?:"
+
host_label
+
R"((?:\.)"
+
host_label
+
R"()*\.?))"
,
host
=
"(?:"
+
hostname
+
"|"
+
ip_literal
+
")"
,
path
=
R"((?:/((?:[a-zA-Z0-9\-._~!$&'*+,;=:@/]|)"
+
pct_enc
+
R"(|\((?-1)\)|)"
+
general_unicode
+
")*))"
,
query
=
R"(((?:[a-zA-Z0-9\-._~!$&'*+,;=:@/?\\{}]|)"
+
pct_enc
+
R"(|\((?-1)\)|\[(?-1)\]|)"
+
general_unicode
+
")*)"
,
fragment
=
query
;
[]()
{
const
auto
general_unicode
=
QStringLiteral
(
R"((?:[^\x{0}-\x{7f}\p{Cc}\s\p{P}]|[\x{2010}\x{2011}\x{2012}\x{2013}\x{2014}\x{2015}]))"
);
const
auto
protocol
=
QStringLiteral
(
R"((?:[Hh][Tt][Tt][Pp][Ss]?))"
);
const
auto
unreserved_subdelims_colon
=
QStringLiteral
(
R"([a-zA-Z0-9\-._~!$&'()*+,;=:])"
);
const
auto
pct_enc
=
QStringLiteral
(
R"((?:%[[:xdigit:]]{2}))"
);
const
auto
userinfo
=
"(?:"
+
unreserved_subdelims_colon
+
"*(?:"
+
pct_enc
+
unreserved_subdelims_colon
+
"*)*)"
;
const
auto
dec_octet
=
QStringLiteral
(
R"((?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))"
);
const
auto
ipv4_addr
=
"(?:"
+
dec_octet
+
R"((?:\.)"
+
dec_octet
+
"){3})"
;
const
auto
h16
=
QStringLiteral
(
R"((?:[[:xdigit:]]{1,4}))"
);
const
auto
ls32
=
"(?:"
+
h16
+
":"
+
h16
+
"|"
+
ipv4_addr
+
")"
;
// clang-format off
const
auto
ipv6_addr
=
"(?:"
"(?:"
+
h16
+
":){6}"
+
ls32
+
"|"
"::(?:"
+
h16
+
":){5}"
+
ls32
+
"|"
+
h16
+
"?::(?:"
+
h16
+
":){4}"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,1})?::(?:"
+
h16
+
":){3}"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,2})?::(?:"
+
h16
+
":){2}"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,3})?::"
+
h16
+
":"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,4})?::"
+
ls32
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,5})?::"
+
h16
+
"|"
"(?:"
+
h16
+
"(?::"
+
h16
+
"){0,6})?::"
")"
;
// clang-format on
const
auto
ipvfuture
=
R"((?:v[[:xdigit:]]+\.)"
+
unreserved_subdelims_colon
+
"+)"
;
const
auto
ip_literal
=
R"((?:\[(?:)"
+
ipv6_addr
+
"|"
+
ipvfuture
+
R"()\]))"
;
const
auto
host_alnum
=
"(?:[a-zA-Z0-9]|"
+
general_unicode
+
")"
;
const
auto
host_label
=
"(?:"
+
host_alnum
+
"+(?:-+"
+
host_alnum
+
"+)*)"
;
const
auto
hostname
=
"(?:"
+
host_label
+
R"((?:\.)"
+
host_label
+
R"()*\.?))"
;
const
auto
host
=
"(?:"
+
hostname
+
"|"
+
ip_literal
+
")"
;
const
auto
path
=
R"((?:/((?:[a-zA-Z0-9\-._~!$&'*+,;=:@/]|)"
+
pct_enc
+
R"(|\((?-1)\)|)"
+
general_unicode
+
")*))"
;
const
auto
query
=
R"(((?:[a-zA-Z0-9\-._~!$&'*+,;=:@/?\\{}]|)"
+
pct_enc
+
R"(|\((?-1)\)|\[(?-1)\]|)"
+
general_unicode
+
")*)"
;
const
auto
&
fragment
=
query
;
return
R"((?<!["'\w])(?>()"
+
protocol
+
"://"
...
...
@@ -69,8 +76,7 @@ const QRegularExpression url_regex(
"(?<![.!?,;:'])"
R"())(?!["']))"
;
}(),
QRegularExpression
::
UseUnicodePropertiesOption
);
QRegularExpression
::
UseUnicodePropertiesOption
);
// A matrix link to be converted back to markdown
static
const
QRegularExpression
matrixToLink
(
QStringLiteral
(
R"(<a href=\"(https://matrix.to/#/.*?)\">(.*?)</a>)"
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment