summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-16 17:46:55 +0100
committerdefault <nobody@localhost>2022-11-16 17:46:55 +0100
commit206dd52275163e197cfa400aa784f7bcf312e9fc (patch)
tree853c29f9fdf3d47528f42adf37d7a761e9b314c0
parent789aec5d7fb040b0ff398375243f9ab4099d348f (diff)
More sanitize tweaks.
-rw-r--r--format.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/format.c b/format.c
index 07a9b5d..42878a0 100644
--- a/format.c
+++ b/format.c
@@ -199,7 +199,8 @@ d_char *sanitize(const char *content)
xs *el = xs_regex_match(v, "(href|rel|class|target)=\"[^\"]*\"");
xs *s3 = xs_join(el, " ");
- s2 = xs_fmt("<%s%s %s>", v[1] == '/' ? "/" : "", tag, s3);
+ s2 = xs_fmt("<%s%s%s%s>",
+ v[1] == '/' ? "/" : "", tag, xs_list_len(s3) ? " " : "", s3);
}
else {
/* bad tag: escape it */