From 98f2ebf11816553c50d86ae772d29d10b0b09011 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Mon, 10 Aug 2026 07:23:36 -0700 Subject: [PATCH] Fix: HtmlBlock sanitizer strips select/meter presentation attrs size, low, high, and optimum were missing from PURIFY_CONFIG.ALLOWED_ATTR even though rendered at default height and lost its threshold-based gauge colouring. All four are pure presentation/semantic attributes with no URL/script/event-handler surface, so no security implication. Also regenerates the pinned pre-Task-25 output fixture: its source (html-block-test-body.html) already exercises size/low/high/optimum, so the byte-identity test's expected output legitimately changes to include them; verified the regenerated fixture's only diff from the prior one is those four attributes now surviving. Co-Authored-By: Claude Opus 5 (1M context) --- .../basic/HtmlBlock.security.test.ts | 28 +++++++++++++++++-- craft/src/components/basic/HtmlBlock.tsx | 10 ++++++- ...tml-block-test-body.pre-task25-output.html | 4 +-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/craft/src/components/basic/HtmlBlock.security.test.ts b/craft/src/components/basic/HtmlBlock.security.test.ts index 03c7799..2c0e2a5 100644 --- a/craft/src/components/basic/HtmlBlock.security.test.ts +++ b/craft/src/components/basic/HtmlBlock.security.test.ts @@ -135,15 +135,20 @@ describe('purifyHtml -- Task 24 fixture regression (formerly-dropped constructs expect(out).toContain(''); + expect(out).toContain('


-

@@ -275,7 +275,7 @@ here

Output and buttons

60%

-

72

+

72

Computed output