summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-01-13 07:02:04 +0100
committerGravatar default2023-01-13 07:02:04 +0100
commite58eb068fb59ed908dd6630b41e9c6747f04fbd5 (patch)
tree4d8139015ff6ca9860231e8d53fb8794f3fe0f0f
parentUpdated TODO. (diff)
downloadsnac2-e58eb068fb59ed908dd6630b41e9c6747f04fbd5.tar.gz
snac2-e58eb068fb59ed908dd6630b41e9c6747f04fbd5.tar.xz
snac2-e58eb068fb59ed908dd6630b41e9c6747f04fbd5.zip
Minor URL formatting tweaks.
-rw-r--r--examples/formatting.txt2
-rw-r--r--format.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/examples/formatting.txt b/examples/formatting.txt
index 8fbd792..685bacf 100644
--- a/examples/formatting.txt
+++ b/examples/formatting.txt
@@ -21,6 +21,6 @@ It also allows preformatted text using three backquotes in a single line:
21 21
22``` 22```
23 23
24URLs like https://en.wikipedia.org/wiki/Main_Page are made clickable. 24URLs like https://en.wikipedia.org/wiki/Main_Page are made clickable, https://codeberg.org/grunfink/snac2.
25 25
26Some emojis: X-D <3 :beer: :shrug: :shrug2: 26Some emojis: X-D <3 :beer: :shrug: :shrug2:
diff --git a/format.c b/format.c
index 58b6c7d..418f59b 100644
--- a/format.c
+++ b/format.c
@@ -71,7 +71,8 @@ static d_char *format_line(const char *line)
71 } 71 }
72 else 72 else
73 if (xs_startswith(v, "http")) { 73 if (xs_startswith(v, "http")) {
74 xs *s1 = xs_fmt("<a href=\"%s\" target=\"_blank\">%s</a>", v, v); 74 xs *v2 = xs_strip_chars_i(xs_dup(v), ".");
75 xs *s1 = xs_fmt("<a href=\"%s\" target=\"_blank\">%s</a>", v2, v);
75 s = xs_str_cat(s, s1); 76 s = xs_str_cat(s, s1);
76 } 77 }
77 else 78 else