Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Sep 13, 2022
1 parent 7d7b0be commit 6333eca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/rich-text/src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ function toFormat( { tagName, attributes } ) {
select( richTextStore ).getFormatTypeForBareElement( tagName );
}

if ( ! formatType ) {
return attributes ? { type: tagName, attributes } : { type: tagName };
}

if (
formatType.__experimentalCreatePrepareEditableTree &&
! formatType.__experimentalCreateOnChangeEditableValue
Expand Down
4 changes: 4 additions & 0 deletions packages/rich-text/src/test/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ export const specWithRegistration = [
[
{
type: 'my-plugin/link',
tagName: 'a',
attributes: {},
unregisteredAttributes: {},
},
Expand All @@ -808,6 +809,7 @@ export const specWithRegistration = [
[
{
type: 'my-plugin/link',
tagName: 'a',
attributes: {},
unregisteredAttributes: {
class: 'test',
Expand All @@ -834,6 +836,7 @@ export const specWithRegistration = [
[
{
type: 'core/link',
tagName: 'a',
attributes: {},
unregisteredAttributes: {
class: 'custom-format',
Expand Down Expand Up @@ -899,6 +902,7 @@ export const specWithRegistration = [
[
{
type: 'my-plugin/link',
tagName: 'a',
attributes: {},
unregisteredAttributes: {},
},
Expand Down

0 comments on commit 6333eca

Please sign in to comment.