Disabled URL replacement by now because it's not infinite-loop-safe.

This commit is contained in:
default 2022-09-27 10:59:29 +02:00
parent 4f3b70d997
commit f516866f9e

9
html.c
View file

@ -58,17 +58,24 @@ d_char *not_really_markdown(char *content, d_char **f_content)
} }
} }
#if 0
{ {
/* urls */ /* urls */
xs *done = xs_list_new();
xs *ml = xs_regex_matchall(wrk, "https?:/" "/[^ ]+"); xs *ml = xs_regex_matchall(wrk, "https?:/" "/[^ ]+");
p = ml; p = ml;
while (xs_list_iter(&p, &v)) { while (xs_list_iter(&p, &v)) {
if (xs_list_in(done, v) == -1) {
xs *s2 = xs_fmt("<a href=\"%s\">%s</a>", v, v); xs *s2 = xs_fmt("<a href=\"%s\">%s</a>", v, v);
wrk = xs_replace_i(wrk, v, s2); wrk = xs_replace_i(wrk, v, s2);
/* keep track of already done replaces */
done = xs_list_append(done, v);
} }
} }
}
#endif
/* now work on lines */ /* now work on lines */