aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-02-09 18:13:01 +0100
committerdefault <nobody@localhost>2025-02-09 18:13:01 +0100
commit6b88ecf3f00fdd80b558e6cb5fbc520f812e9764 (patch)
treef33077c3eafbdcc6544d7fe61ef51effd5dc179b
parent3db7d9f58abe4595fbc75fb9d08dc84eba742bdd (diff)
parentd9b6b7ce086e0372e33f855d913891d624024898 (diff)
Merge branch 'master' of comam.es:git/snac2
-rw-r--r--xs_html.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xs_html.h b/xs_html.h
index 8331f93..29886c6 100644
--- a/xs_html.h
+++ b/xs_html.h
@@ -114,7 +114,7 @@ xs_html *xs_html_text(const char *content)
xs_html *a = XS_HTML_NEW();
a->type = XS_HTML_TEXT;
- a->content = xs_html_encode(content);
+ a->content = xs_is_string(content) ? xs_html_encode(content) : xs_str_new(NULL);
return a;
}
@@ -126,7 +126,7 @@ xs_html *xs_html_raw(const char *content)
xs_html *a = XS_HTML_NEW();
a->type = XS_HTML_TEXT;
- a->content = xs_dup(content);
+ a->content = xs_is_string(content) ? xs_dup(content) : xs_str_new(NULL);
return a;
}