-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List v2: fix migration when nested list is invalid (#44822)
* List v2: fix migration when nested list is invalid * Reduce test case
- Loading branch information
Showing
5 changed files
with
158 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
test/integration/fixtures/blocks/core__list__deprecated-v1-nested.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!-- wp:list --> | ||
<ul><li><strong>Item</strong><ul><li><strong>Item</strong><ul><li><a rel="noreferrer noopener" href="#" target="_blank">Item</a></li></ul></li></ul><ul><li><strong>Item</strong><ul><li><a rel="noreferrer noopener" href="#" target="_blank">Item</a></li></ul></li></ul><ul><li><strong>Item</strong><ul><li><a rel="noreferrer noopener" href="#" target="_blank">Item</a></li></ul></li></ul></li></ul> | ||
<!-- /wp:list --> |
112 changes: 112 additions & 0 deletions
112
test/integration/fixtures/blocks/core__list__deprecated-v1-nested.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
[ | ||
{ | ||
"name": "core/list", | ||
"isValid": true, | ||
"attributes": { | ||
"ordered": false, | ||
"values": "" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<strong>Item</strong>" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list", | ||
"isValid": true, | ||
"attributes": { | ||
"ordered": false, | ||
"values": "" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<strong>Item</strong>" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list", | ||
"isValid": true, | ||
"attributes": { | ||
"ordered": false, | ||
"values": "" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a>" | ||
}, | ||
"innerBlocks": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<strong>Item</strong>" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list", | ||
"isValid": true, | ||
"attributes": { | ||
"ordered": false, | ||
"values": "" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a>" | ||
}, | ||
"innerBlocks": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<strong>Item</strong>" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list", | ||
"isValid": true, | ||
"attributes": { | ||
"ordered": false, | ||
"values": "" | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/list-item", | ||
"isValid": true, | ||
"attributes": { | ||
"content": "<a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a>" | ||
}, | ||
"innerBlocks": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
test/integration/fixtures/blocks/core__list__deprecated-v1-nested.parsed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"blockName": "core/list", | ||
"attrs": {}, | ||
"innerBlocks": [], | ||
"innerHTML": "\n<ul><li><strong>Item</strong><ul><li><strong>Item</strong><ul><li><a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a></li></ul></li></ul><ul><li><strong>Item</strong><ul><li><a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a></li></ul></li></ul><ul><li><strong>Item</strong><ul><li><a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a></li></ul></li></ul></li></ul>\n", | ||
"innerContent": [ | ||
"\n<ul><li><strong>Item</strong><ul><li><strong>Item</strong><ul><li><a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a></li></ul></li></ul><ul><li><strong>Item</strong><ul><li><a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a></li></ul></li></ul><ul><li><strong>Item</strong><ul><li><a rel=\"noreferrer noopener\" href=\"#\" target=\"_blank\">Item</a></li></ul></li></ul></li></ul>\n" | ||
] | ||
} | ||
] |
29 changes: 29 additions & 0 deletions
29
test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- wp:list --> | ||
<ul><!-- wp:list-item --> | ||
<li><strong>Item</strong><!-- wp:list --> | ||
<ul><!-- wp:list-item --> | ||
<li><strong>Item</strong><!-- wp:list --> | ||
<ul><!-- wp:list-item --> | ||
<li><a rel="noreferrer noopener" href="#" target="_blank">Item</a></li> | ||
<!-- /wp:list-item --></ul> | ||
<!-- /wp:list --></li> | ||
<!-- /wp:list-item --> | ||
|
||
<!-- wp:list-item --> | ||
<li><strong>Item</strong><!-- wp:list --> | ||
<ul><!-- wp:list-item --> | ||
<li><a rel="noreferrer noopener" href="#" target="_blank">Item</a></li> | ||
<!-- /wp:list-item --></ul> | ||
<!-- /wp:list --></li> | ||
<!-- /wp:list-item --> | ||
|
||
<!-- wp:list-item --> | ||
<li><strong>Item</strong><!-- wp:list --> | ||
<ul><!-- wp:list-item --> | ||
<li><a rel="noreferrer noopener" href="#" target="_blank">Item</a></li> | ||
<!-- /wp:list-item --></ul> | ||
<!-- /wp:list --></li> | ||
<!-- /wp:list-item --></ul> | ||
<!-- /wp:list --></li> | ||
<!-- /wp:list-item --></ul> | ||
<!-- /wp:list --> |