diff options
| author | Santtu Lakkala <inz@inz.fi> | 2025-01-31 13:58:10 +0200 |
|---|---|---|
| committer | Santtu Lakkala <santtu.lakkala@unikie.com> | 2025-02-05 10:57:27 +0200 |
| commit | 52c45718208f076ba1e4a30d7d54655cb4dcc78c (patch) | |
| tree | f7eae615376ba7aa64ba1d7351d0b9a935f63649 /format.c | |
| parent | 8f76c4d8f6ac9d4fa81ab9fd13d8f5e8e65ea8b8 (diff) | |
Fix link detection. Fixes: #290
Diffstat (limited to 'format.c')
| -rw-r--r-- | format.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -78,6 +78,8 @@ xs_dict *emojis(void) return d; } +/* Non-whitespace without trailing comma, period or closing paren */ +#define NOSPACE "([^[:space:],.)]+|[,.)]+[^[:space:],.)])+" static xs_str *format_line(const char *line, xs_list **attach) /* formats a line */ @@ -96,8 +98,8 @@ static xs_str *format_line(const char *line, xs_list **attach) "__[^_]+__" "|" //anzu "!\\[[^]]+\\]\\([^\\)]+\\)" "|" "\\[[^]]+\\]\\([^\\)]+\\)" "|" - "[a-z]+:/" "/[^[:space:]]+" "|" - "(mailto|xmpp):[^@[:space:]]+@[^[:space:]]+" + "[a-z]+:/" "/" NOSPACE "|" + "(mailto|xmpp):[^@[:space:]]+@" NOSPACE ")"); int n = 0; |