Skip to content

Commit

Permalink
Prevent freeform and shortcode blocks from converting HTML entities (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Jun 1, 2023
1 parent a88f3c2 commit df94b48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/freeform/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"attributes": {
"content": {
"type": "string",
"source": "html"
"source": "raw"
}
},
"supports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/shortcode/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"attributes": {
"text": {
"type": "string",
"source": "html"
"source": "raw"
}
},
"supports": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe( 'invalid blocks', () => {
expect( hasAlert ).toBe( false );
} );

it( 'should strip potentially malicious script tags', async () => {
it( 'should not trigger malicious script tags when using a shortcode block', async () => {
let hasAlert = false;

page.on( 'dialog', () => {
Expand All @@ -94,9 +94,6 @@ describe( 'invalid blocks', () => {

// Give the browser time to show the alert.
await page.evaluate( () => new Promise( window.requestIdleCallback ) );

expect( console ).toHaveWarned();
expect( console ).toHaveErrored();
expect( hasAlert ).toBe( false );
} );
} );

1 comment on commit df94b48

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in df94b48.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5142762933
📝 Reported issues:

Please sign in to comment.