From 5c27885a2f35106dc7934b8e9c08986004ba0a58 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 11 Feb 2025 18:45:52 +0100 Subject: In sanitize(), also accept attribute values between single quotes. --- format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'format.c') diff --git a/format.c b/format.c index 4c8ed29..755aeb2 100644 --- a/format.c +++ b/format.c @@ -458,7 +458,7 @@ xs_str *sanitize(const char *content) if (valid_tags[i]) { /* accepted tag: rebuild it with only the accepted elements */ - xs *el = xs_regex_select(v, "(src|href|rel|class|target)=\"[^\"]*\""); + xs *el = xs_regex_select(v, "(src|href|rel|class|target)=(\"[^\"]*\"|'[^']*')"); xs *s3 = xs_join(el, " "); s2 = xs_fmt("<%s%s%s%s>", -- cgit v1.2.3