mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Disabled URL replacement by now because it's not infinite-loop-safe.
This commit is contained in:
parent
4f3b70d997
commit
f516866f9e
1 changed files with 9 additions and 2 deletions
9
html.c
9
html.c
|
@ -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 */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue