commit b510858

default  ·  2025-01-08 16:20:53 +0000 UTC
parent 932227b
Also check for the lowecase URL of the hashtags.
3 files changed,  +9, -3
M html.c
+2, -1
 1@@ -42,7 +42,8 @@ data.o: data.c xs.h xs_hex.h xs_io.h xs_json.h xs_openssl.h xs_glob.h \
 2 format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \
 3  xs_time.h xs_match.h snac.h http_codes.h
 4 html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \
 5- xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h snac.h http_codes.h
 6+ xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h xs_unicode.h snac.h \
 7+ http_codes.h
 8 http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \
 9  snac.h http_codes.h
10 httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \
+2, -1
 1@@ -44,7 +44,8 @@ data.o: data.c xs.h xs_hex.h xs_io.h xs_json.h xs_openssl.h xs_glob.h \
 2 format.o: format.c xs.h xs_regex.h xs_mime.h xs_html.h xs_json.h \
 3  xs_time.h xs_match.h snac.h http_codes.h
 4 html.o: html.c xs.h xs_io.h xs_json.h xs_regex.h xs_set.h xs_openssl.h \
 5- xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h snac.h http_codes.h
 6+ xs_time.h xs_mime.h xs_match.h xs_html.h xs_curl.h xs_unicode.h snac.h \
 7+ http_codes.h
 8 http.o: http.c xs.h xs_io.h xs_openssl.h xs_curl.h xs_time.h xs_json.h \
 9  snac.h http_codes.h
10 httpd.o: httpd.c xs.h xs_io.h xs_json.h xs_socket.h xs_unix_socket.h \
M html.c
+5, -1
 1@@ -12,6 +12,7 @@
 2 #include "xs_match.h"
 3 #include "xs_html.h"
 4 #include "xs_curl.h"
 5+#include "xs_unicode.h"
 6 
 7 #include "snac.h"
 8 
 9@@ -2203,8 +2204,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
10 
11             if (xs_type(type) == XSTYPE_STRING && strcmp(type, "Hashtag") == 0) {
12                 const char *href = xs_dict_get(tag, "href");
13+                xs *lc_href = xs_utf8_to_lower(href);
14 
15-                if (xs_type(href) == XSTYPE_STRING && xs_str_in(content, href) == -1) {
16+                if (xs_type(href) == XSTYPE_STRING &&
17+                    xs_str_in(content, href) == -1 &&
18+                    xs_str_in(content, lc_href) == -1) {
19                     /* not in the content: add here */
20                     const char *name = xs_dict_get(tag, "name");
21