summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-05-21 20:11:06 +0200
committerGravatar default2023-05-21 20:11:06 +0200
commit63053ab5dbca8b8c1424d335f20c3af85e4a1fbb (patch)
tree4c3bad47db7bafd7ce84a278668e9afa41677a49
parentMore image tweaks. (diff)
downloadsnac2-63053ab5dbca8b8c1424d335f20c3af85e4a1fbb.tar.gz
snac2-63053ab5dbca8b8c1424d335f20c3af85e4a1fbb.tar.xz
snac2-63053ab5dbca8b8c1424d335f20c3af85e4a1fbb.zip
Minor prototype change.
-rw-r--r--format.c12
-rw-r--r--snac.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/format.c b/format.c
index b62cd50..14508b9 100644
--- a/format.c
+++ b/format.c
@@ -38,10 +38,10 @@ struct {
38}; 38};
39 39
40 40
41static d_char *format_line(const char *line) 41static xs_str *format_line(const char *line)
42/* formats a line */ 42/* formats a line */
43{ 43{
44 d_char *s = xs_str_new(NULL); 44 xs_str *s = xs_str_new(NULL);
45 char *p, *v; 45 char *p, *v;
46 46
47 /* split by markup */ 47 /* split by markup */
@@ -90,10 +90,10 @@ static d_char *format_line(const char *line)
90} 90}
91 91
92 92
93d_char *not_really_markdown(const char *content) 93xs_str *not_really_markdown(const char *content)
94/* formats a content using some Markdown rules */ 94/* formats a content using some Markdown rules */
95{ 95{
96 d_char *s = xs_str_new(NULL); 96 xs_str *s = xs_str_new(NULL);
97 int in_pre = 0; 97 int in_pre = 0;
98 int in_blq = 0; 98 int in_blq = 0;
99 xs *list; 99 xs *list;
@@ -172,10 +172,10 @@ const char *valid_tags[] = {
172 "span", "i", "b", "u", "pre", "code", "em", "strong", NULL 172 "span", "i", "b", "u", "pre", "code", "em", "strong", NULL
173}; 173};
174 174
175d_char *sanitize(const char *content) 175xs_str *sanitize(const char *content)
176/* cleans dangerous HTML output */ 176/* cleans dangerous HTML output */
177{ 177{
178 d_char *s = xs_str_new(NULL); 178 xs_str *s = xs_str_new(NULL);
179 xs *sl; 179 xs *sl;
180 int n = 0; 180 int n = 0;
181 char *p, *v; 181 char *p, *v;
diff --git a/snac.h b/snac.h
index b06f786..5ee86b4 100644
--- a/snac.h
+++ b/snac.h
@@ -228,8 +228,8 @@ int activitypub_post_handler(const xs_dict *req, const char *q_path,
228 char *payload, int p_size, 228 char *payload, int p_size,
229 char **body, int *b_size, char **ctype); 229 char **body, int *b_size, char **ctype);
230 230
231d_char *not_really_markdown(const char *content); 231xs_str *not_really_markdown(const char *content);
232d_char *sanitize(const char *str); 232xs_str *sanitize(const char *content);
233 233
234int html_get_handler(const xs_dict *req, const char *q_path, 234int html_get_handler(const xs_dict *req, const char *q_path,
235 char **body, int *b_size, char **ctype); 235 char **body, int *b_size, char **ctype);