diff options
author | default <nobody@localhost> | 2023-06-12 19:01:17 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-06-12 19:01:17 +0200 |
commit | b9dee83f27437941df6d7c7df3ca6bf2a89a56cc (patch) | |
tree | c11a098ea1ed75a8bc4d3f6fba418efcc5376d3b | |
parent | 0157ac626c3bf2098763eeef9e9a6007197ae7f1 (diff) |
Fix links with # in it.
-rw-r--r-- | format.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -73,7 +73,8 @@ static xs_str *format_line(const char *line, xs_list **attach) } else if (xs_startswith(v, "http")) { - xs *v2 = xs_strip_chars_i(xs_dup(v), "."); + xs *u = xs_replace(v, "#", "#"); + xs *v2 = xs_strip_chars_i(xs_dup(u), "."); const char *mime = xs_mime_by_ext(v2); @@ -89,7 +90,7 @@ static xs_str *format_line(const char *line, xs_list **attach) *attach = xs_list_append(*attach, d); } else { - xs *s1 = xs_fmt("<a href=\"%s\" target=\"_blank\">%s</a>", v2, v); + xs *s1 = xs_fmt("<a href=\"%s\" target=\"_blank\">%s</a>", v2, u); s = xs_str_cat(s, s1); } } |