diff options
| author | 2025-05-28 08:45:44 +0200 | |
|---|---|---|
| committer | 2025-05-28 08:45:44 +0200 | |
| commit | e2bb8078641f810b019635dd41f3e7ea191c5b52 (patch) | |
| tree | 4184d95768392db79706a5b8ec17c49ac9edbed7 /html.c | |
| parent | Disabled rss_process() by now. (diff) | |
| download | penes-snac2-e2bb8078641f810b019635dd41f3e7ea191c5b52.tar.gz penes-snac2-e2bb8078641f810b019635dd41f3e7ea191c5b52.tar.xz penes-snac2-e2bb8078641f810b019635dd41f3e7ea191c5b52.zip | |
Don't prepend a # before a hashtag that is really an URL.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 13 |
1 files changed, 10 insertions, 3 deletions
| @@ -4956,9 +4956,16 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 4956 | if (*s1 == '\0') | 4956 | if (*s1 == '\0') |
| 4957 | continue; | 4957 | continue; |
| 4958 | 4958 | ||
| 4959 | xs *s2 = xs_utf8_to_lower(s1); | 4959 | xs *s2 = NULL; |
| 4960 | if (*s2 != '#') | 4960 | |
| 4961 | s2 = xs_str_prepend_i(s2, "#"); | 4961 | if (xs_startswith(s1, "https:/")) |
| 4962 | s2 = xs_dup(s1); | ||
| 4963 | else { | ||
| 4964 | s2 = xs_utf8_to_lower(s1); | ||
| 4965 | |||
| 4966 | if (*s2 != '#') | ||
| 4967 | s2 = xs_str_prepend_i(s2, "#"); | ||
| 4968 | } | ||
| 4962 | 4969 | ||
| 4963 | new_hashtags = xs_list_append(new_hashtags, s2); | 4970 | new_hashtags = xs_list_append(new_hashtags, s2); |
| 4964 | } | 4971 | } |