From ff1c3f57914d9dbc3014effda0c07260dfdf051d Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Tue, 26 Mar 2024 08:25:37 -0700 Subject: [PATCH] server: preserve class attribute on sanitized html --- server/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/lib.rs b/server/src/lib.rs index c67d982..91d2259 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -83,8 +83,9 @@ pub fn sanitize_html(html: &str) -> Result { } }; // Default's don't allow style, but we want to preserve that. - let attributes = - hashset!["align", "bgcolor", "color", "height", "lang", "title", "width", "style",]; + let attributes = hashset![ + "align", "bgcolor", "class", "color", "height", "lang", "title", "width", "style", + ]; let tags = hashset![ "a",