import {test, expect} from '../../fixtures/test' // tags belong in
only. In a content body they are used to // inject external stylesheets (CSS injection attack) or load external // resources. canvas-rce must strip them to prevent style hijacking. test.describe(' tag in body — must be stripped', () => { test.beforeEach(async ({page, rcePage}) => { await page.goto('/scenarios/basic') await rcePage.waitForEditor() }) async function setAndGet(page: any, html: string): PromiseSafe text
', ) expect(content).not.toContain(' is stripped', async ({page}) => { const content = await setAndGet( page, 'Content
', ) expect(content).not.toContain(' is stripped', async ({page}) => { const content = await setAndGet( page, 'Page content
', ) expect(content).not.toContain(' tags is preserved', async ({page}) => { const content = await setAndGet( page, 'Body
Footer
', ) expect(content).toContain('Title') expect(content).toContain('Body') expect(content).toContain('Footer') expect(content).not.toContain('