commit 258850f

default  ·  2023-11-22 12:07:19 +0000 UTC
parent 4e8beaa
Backport from xs.
3 files changed,  +8, -8
M html.c
M html.c
+1, -1
1@@ -2270,7 +2270,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2                         xs_html_text(content))));
3         }
4 
5-        *body   = _xs_html_render(rss, xs_dup("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"));
6+        *body   = xs_html_render_s(rss, xs_dup("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"));
7         *b_size = strlen(*body);
8         *ctype  = "application/rss+xml; charset=utf-8";
9         status  = 200;
+6, -6
 1@@ -21,8 +21,8 @@ xs_html *_xs_html_tag(char *tag, xs_html *var[]);
 2 xs_html *_xs_html_sctag(char *tag, xs_html *var[]);
 3 #define xs_html_sctag(tag, ...) _xs_html_sctag(tag, (xs_html *[]) { __VA_ARGS__, NULL })
 4 
 5-xs_str *_xs_html_render(xs_html *h, xs_str *s);
 6-#define xs_html_render(h) _xs_html_render(h, xs_str_new(NULL))
 7+xs_str *xs_html_render_s(xs_html *h, xs_str *s);
 8+#define xs_html_render(h) xs_html_render_s(h, xs_str_new(NULL))
 9 
10 #ifdef XS_IMPLEMENTATION
11 
12@@ -187,8 +187,8 @@ xs_html *_xs_html_sctag(char *tag, xs_html *var[])
13 }
14 
15 
16-xs_str *_xs_html_render(xs_html *h, xs_str *s)
17-/* renders the tag and its subtags */
18+xs_str *xs_html_render_s(xs_html *h, xs_str *s)
19+/* renders the tag and its subtags into s */
20 {
21     xs_html *st;
22 
23@@ -201,7 +201,7 @@ xs_str *_xs_html_render(xs_html *h, xs_str *s)
24         st = h->f_attr;
25         while (st) {
26             xs_html *nst = st->next;
27-            s = _xs_html_render(st, s);
28+            s = xs_html_render_s(st, s);
29             st = nst;
30         }
31 
32@@ -216,7 +216,7 @@ xs_str *_xs_html_render(xs_html *h, xs_str *s)
33             st = h->f_tag;
34             while (st) {
35                 xs_html *nst = st->next;
36-                s = _xs_html_render(st, s);
37+                s = xs_html_render_s(st, s);
38                 st = nst;
39             }
40 
+1, -1
1@@ -1 +1 @@
2-/* d9404322f5bad91811bc0ad13d63360b586919cc 2023-11-20T20:13:34+01:00 */
3+/* 2adde1fad4fabb223639e4002a7ff3ec8c1982d7 2023-11-22T13:05:51+01:00 */