Fixed a minor bug in processing Markdown-style links having anchors.

This commit is contained in:
default 2024-06-27 05:30:53 +02:00
parent c016b68629
commit 6f772e4770

View file

@ -143,8 +143,8 @@ static xs_str *format_line(const char *line, xs_list **attach)
else else
if (*v == '[') { if (*v == '[') {
/* markdown-like links [label](url) */ /* markdown-like links [label](url) */
xs *w = xs_strip_chars_i(xs_dup(v), "[)"); xs *w = xs_strip_chars_i(xs_replace(v, "#", "#"), "[)");
xs *l = xs_split_n(w, "](", 1); xs *l = xs_split_n(w, "](", 1);
if (xs_list_len(l) == 2) { if (xs_list_len(l) == 2) {
xs *link = xs_fmt("<a href=\"%s\">%s</a>", xs *link = xs_fmt("<a href=\"%s\">%s</a>",