diff options
| -rw-r--r-- | format.c | 6 | ||||
| -rw-r--r-- | html.c | 8 |
2 files changed, 11 insertions, 3 deletions
| @@ -78,6 +78,8 @@ xs_dict *emojis(void) | |||
| 78 | return d; | 78 | return d; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /* Non-whitespace without trailing comma, period or closing paren */ | ||
| 82 | #define NOSPACE "([^[:space:],.)]+|[,.)]+[^[:space:],.)])+" | ||
| 81 | 83 | ||
| 82 | static xs_str *format_line(const char *line, xs_list **attach) | 84 | static xs_str *format_line(const char *line, xs_list **attach) |
| 83 | /* formats a line */ | 85 | /* formats a line */ |
| @@ -96,8 +98,8 @@ static xs_str *format_line(const char *line, xs_list **attach) | |||
| 96 | "__[^_]+__" "|" //anzu | 98 | "__[^_]+__" "|" //anzu |
| 97 | "!\\[[^]]+\\]\\([^\\)]+\\)" "|" | 99 | "!\\[[^]]+\\]\\([^\\)]+\\)" "|" |
| 98 | "\\[[^]]+\\]\\([^\\)]+\\)" "|" | 100 | "\\[[^]]+\\]\\([^\\)]+\\)" "|" |
| 99 | "[a-z]+:/" "/[^[:space:]]+" "|" | 101 | "[a-z]+:/" "/" NOSPACE "|" |
| 100 | "(mailto|xmpp):[^@[:space:]]+@[^[:space:]]+" | 102 | "(mailto|xmpp):[^@[:space:]]+@" NOSPACE |
| 101 | ")"); | 103 | ")"); |
| 102 | int n = 0; | 104 | int n = 0; |
| 103 | 105 | ||
| @@ -3129,11 +3129,16 @@ xs_str *html_notifications(snac *user, int skip, int show) | |||
| 3129 | else | 3129 | else |
| 3130 | if (obj != NULL) { | 3130 | if (obj != NULL) { |
| 3131 | xs *md5 = xs_md5_hex(id, strlen(id)); | 3131 | xs *md5 = xs_md5_hex(id, strlen(id)); |
| 3132 | xs *ctxt = xs_fmt("%s/admin/p/%s#%s_entry", user->actor, md5, md5); | ||
| 3132 | 3133 | ||
| 3133 | xs_html *h = html_entry(user, obj, 0, 0, md5, 1); | 3134 | xs_html *h = html_entry(user, obj, 0, 0, md5, 1); |
| 3134 | 3135 | ||
| 3135 | if (h != NULL) { | 3136 | if (h != NULL) { |
| 3136 | xs_html_add(entry, | 3137 | xs_html_add(entry, |
| 3138 | xs_html_tag("p", | ||
| 3139 | xs_html_tag("a", | ||
| 3140 | xs_html_attr("href", ctxt), | ||
| 3141 | xs_html_text(L("Context")))), | ||
| 3137 | h); | 3142 | h); |
| 3138 | } | 3143 | } |
| 3139 | } | 3144 | } |
| @@ -3540,7 +3545,8 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 3540 | const char *md5 = xs_list_get(l, -1); | 3545 | const char *md5 = xs_list_get(l, -1); |
| 3541 | 3546 | ||
| 3542 | if (md5 && *md5 && timeline_here(&snac, md5)) { | 3547 | if (md5 && *md5 && timeline_here(&snac, md5)) { |
| 3543 | xs *list = xs_list_append(xs_list_new(), md5); | 3548 | xs *list0 = xs_list_append(xs_list_new(), md5); |
| 3549 | xs *list = timeline_top_level(&snac, list0); | ||
| 3544 | 3550 | ||
| 3545 | *body = html_timeline(&snac, list, 0, 0, 0, 0, NULL, "/admin", 1, error); | 3551 | *body = html_timeline(&snac, list, 0, 0, 0, 0, NULL, "/admin", 1, error); |
| 3546 | *b_size = strlen(*body); | 3552 | *b_size = strlen(*body); |