commit 5c27885

default  ·  2025-02-11 17:45:52 +0000 UTC
parent 165e380
In sanitize(), also accept attribute values between single quotes.
1 files changed,  +1, -1
+1, -1
1@@ -458,7 +458,7 @@ xs_str *sanitize(const char *content)
2 
3             if (valid_tags[i]) {
4                 /* accepted tag: rebuild it with only the accepted elements */
5-                xs *el = xs_regex_select(v, "(src|href|rel|class|target)=\"[^\"]*\"");
6+                xs *el = xs_regex_select(v, "(src|href|rel|class|target)=(\"[^\"]*\"|'[^']*')");
7                 xs *s3 = xs_join(el, " ");
8 
9                 s2 = xs_fmt("<%s%s%s%s>",