Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/fields/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- Normalize special characters in exported pattern filenames to prevent broken or unreadable files. ([#77033](https://github.com/WordPress/gutenberg/pull/77033))

### Internal

- Remove unused dependencies `@wordpress/hooks`, `@wordpress/primitives`, `@wordpress/router`, etc. ([#82103](https://github.com/WordPress/gutenberg/pull/82103)).
Expand Down
9 changes: 7 additions & 2 deletions packages/fields/src/actions/export-pattern.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { paramCase as kebabCase } from 'change-case';
import { downloadZip } from 'client-zip';
import removeAccents from 'remove-accents';
import { downloadBlob } from '@wordpress/blob';
import { __ } from '@wordpress/i18n';
import { download } from '@wordpress/icons';
Expand Down Expand Up @@ -33,15 +34,19 @@ const exportPattern: Action< Pattern > = {
if ( items.length === 1 ) {
return downloadBlob(
`${ kebabCase(
getItemTitle( items[ 0 ] ) || items[ 0 ].slug
removeAccents(
getItemTitle( items[ 0 ] ) || items[ 0 ].slug
)
) }.json`,
getJsonFromItem( items[ 0 ] ),
'application/json'
);
}
const nameCount: Record< string, number > = {};
const filesToZip = items.map( ( item ) => {
const name = kebabCase( getItemTitle( item ) || item.slug );
const name = kebabCase(
removeAccents( getItemTitle( item ) || item.slug )
);
nameCount[ name ] = ( nameCount[ name ] || 0 ) + 1;
return {
name: `${
Expand Down
4 changes: 4 additions & 0 deletions packages/list-reusable-blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- Normalize special characters in exported reusable block filenames to prevent broken or unreadable files. ([#77033](https://github.com/WordPress/gutenberg/pull/77033))

## 5.54.0 (2026-08-26)

## 5.53.0 (2026-08-12)
Expand Down
3 changes: 2 additions & 1 deletion packages/list-reusable-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"@wordpress/core-data": "file:../core-data",
"@wordpress/element": "file:../element",
"@wordpress/i18n": "file:../i18n",
"change-case": "^4.1.2"
"change-case": "^4.1.2",
"remove-accents": "^0.5.0"
},
"peerDependencies": {
"@types/react": "^18 || ^19",
Expand Down
3 changes: 2 additions & 1 deletion packages/list-reusable-blocks/src/utils/export.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { paramCase as kebabCase } from 'change-case';
import removeAccents from 'remove-accents';
import apiFetch from '@wordpress/api-fetch';
import { downloadBlob } from '@wordpress/blob';
import type { Post, PostType } from './types';
Expand Down Expand Up @@ -32,7 +33,7 @@ async function exportReusableBlock( id: number ): Promise< void > {
2
);

const fileName = kebabCase( title ) + '.json';
const fileName = kebabCase( removeAccents( title ) ) + '.json';

downloadBlob( fileName, fileContent, 'application/json' );
}
Expand Down
Loading