summaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-06-27 05:30:53 +0200
committerdefault <nobody@localhost>2024-06-27 05:30:53 +0200
commit6f772e477059973f6c5408e380db6409374316bf (patch)
tree87ca88272ad78ecf298ed4f0908e0d03047eff42 /format.c
parentc016b686293e1b8d8a01dd7608c7ddec249a97b5 (diff)
Fixed a minor bug in processing Markdown-style links having anchors.
Diffstat (limited to 'format.c')
-rw-r--r--format.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/format.c b/format.c
index 1020ddd..c30fd5d 100644
--- a/format.c
+++ b/format.c
@@ -143,8 +143,8 @@ static xs_str *format_line(const char *line, xs_list **attach)
else
if (*v == '[') {
/* markdown-like links [label](url) */
- xs *w = xs_strip_chars_i(xs_dup(v), "[)");
- xs *l = xs_split_n(w, "](", 1);
+ xs *w = xs_strip_chars_i(xs_replace(v, "#", "&#35;"), "[)");
+ xs *l = xs_split_n(w, "](", 1);
if (xs_list_len(l) == 2) {
xs *link = xs_fmt("<a href=\"%s\">%s</a>",