mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
Fix links with # in it.
This commit is contained in:
parent
0157ac626c
commit
b9dee83f27
1 changed files with 3 additions and 2 deletions
5
format.c
5
format.c
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue