aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-08 17:20:53 +0100
committerdefault <nobody@localhost>2025-01-08 17:20:53 +0100
commitb51085831e40dbcbd5ff80e033c1b59702cbc920 (patch)
treee5f59d3bc28c300bde6b55382230ba569a15c0a7 /html.c
parent932227bbac7fe740bff1e38bf92b58edef19e32f (diff)
Also check for the lowecase URL of the hashtags.
Diffstat (limited to 'html.c')
-rw-r--r--html.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/html.c b/html.c
index 5a62d16..bade62a 100644
--- a/html.c
+++ b/html.c
@@ -12,6 +12,7 @@
#include "xs_match.h"
#include "xs_html.h"
#include "xs_curl.h"
+#include "xs_unicode.h"
#include "snac.h"
@@ -2203,8 +2204,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
if (xs_type(type) == XSTYPE_STRING && strcmp(type, "Hashtag") == 0) {
const char *href = xs_dict_get(tag, "href");
+ xs *lc_href = xs_utf8_to_lower(href);
- if (xs_type(href) == XSTYPE_STRING && xs_str_in(content, href) == -1) {
+ if (xs_type(href) == XSTYPE_STRING &&
+ xs_str_in(content, href) == -1 &&
+ xs_str_in(content, lc_href) == -1) {
/* not in the content: add here */
const char *name = xs_dict_get(tag, "name");