diff --git a/craft/src/components/basic/HtmlBlock.test.ts b/craft/src/components/basic/HtmlBlock.test.ts index 4b9ebed..3aa46c3 100644 --- a/craft/src/components/basic/HtmlBlock.test.ts +++ b/craft/src/components/basic/HtmlBlock.test.ts @@ -22,6 +22,41 @@ describe('purifyHtml', () => { }); }); +describe('purifyHtml markup path (C1 review finding)', () => { + test('a style attribute survives sanitization (colour picker output must not be silently dropped)', () => { + const out = purifyHtml('
red text
'); + expect(out).toBe('red text
'); + }); + + test('an id attribute survives sanitization (anchor targets)', () => { + const out = purifyHtml('link'); + expect(out).toContain('id="section"'); + }); + + test('a pasted table survives sanitization', () => { + const input = '| Head |
|---|
| Cell |
ok
'); + expect(out).not.toContain('