diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2024-02-11 20:51:22 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2024-02-11 20:51:22 -0300 |
commit | a2ef5613ea76cee2bb634e7b3976cc9b4f7b82d5 (patch) | |
tree | f9382b9f743d37a1114a86aea6e04ec7bb67a753 /src/common | |
parent | 05bbe1d5a6329c6bcfa4108694533330f243d0a1 (diff) |
Parse fedilinks
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/url.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/common/url.c b/src/common/url.c index ae85ae44..162c5706 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -536,6 +536,7 @@ struct { "lastfm", "/", URI_PATH }, { "xfire", "", URI_PATH }, { "ts3server", "", URI_PATH }, + { "web+*", "", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH }, { NULL, "", 0} }; @@ -569,7 +570,21 @@ re_url (void) g_string_append (grist_gstr, "|"); g_string_append (grist_gstr, "("); - g_string_append_printf (grist_gstr, "%s:", uri[i].scheme); + + if (!strcmp(uri[i].scheme, "web+*")) + { + g_string_append(grist_gstr, "web\\+[a-z]+"); + } + else + { + char *scheme_escaped = g_regex_escape_string (uri[i].scheme, strlen(uri[i].scheme)); + + g_string_append_printf (grist_gstr, "%s", scheme_escaped); + + g_free (scheme_escaped); + } + + g_string_append(grist_gstr, ":"); if (uri[i].flags & URI_AUTHORITY) g_string_append (grist_gstr, "//"); |