Skip to content

Commit

Permalink
Restore anchor in raw transform
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and oandregal committed Aug 24, 2022
1 parent f8963bc commit 64b8794
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/block-library/src/list/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export default function save( { attributes } ) {
const { ordered, type, reversed, start } = attributes;
const TagName = ordered ? 'ol' : 'ul';
return (
<TagName
reversed={ reversed }
start={ start }
{ ...useBlockProps.save( { type, reversed, start } ) }
>
<TagName { ...useBlockProps.save( { type, reversed, start } ) }>
<InnerBlocks.Content />
</TagName>
);
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/list/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { createBlock } from '@wordpress/blocks';
export function createListBlockFromDOMElement( listElement ) {
const listAttributes = {
ordered: 'OL' === listElement.tagName,
anchor: listElement.id === '' ? undefined : listElement.id,
start: listElement.getAttribute( 'start' )
? parseInt( listElement.getAttribute( 'start' ), 10 )
: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ exports[`rawHandler should convert a caption shortcode with link 1`] = `
exports[`rawHandler should convert a list with attributes 1`] = `
"<!-- wp:list {\\"ordered\\":true,\\"type\\":\\"i\\",\\"start\\":2,\\"reversed\\":true} -->
<ol reversed start=\\"2\\" type=\\"i\\"><!-- wp:list-item -->
<ol type=\\"i\\" reversed start=\\"2\\"><!-- wp:list-item -->
<li>1<!-- wp:list {\\"ordered\\":true,\\"type\\":\\"i\\",\\"start\\":2,\\"reversed\\":true} -->
<ol reversed start=\\"2\\" type=\\"i\\"><!-- wp:list-item -->
<ol type=\\"i\\" reversed start=\\"2\\"><!-- wp:list-item -->
<li>1</li>
<!-- /wp:list-item --></ol>
<!-- /wp:list --></li>
Expand Down

0 comments on commit 64b8794

Please sign in to comment.