Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of contents: add spacing supports #43368

Merged
merged 2 commits into from
Aug 19, 2022
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
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ Summarize your post with a list of headings. Add HTML anchors to Heading blocks

- **Name:** core/table-of-contents
- **Category:** layout
- **Supports:** ~~html~~
- **Supports:** spacing (margin, padding), ~~html~~
- **Attributes:** headings, onlyIncludeCurrentPage

## Tag Cloud
Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/table-of-contents/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
}
},
"supports": {
"html": false
"html": false,
"spacing": {
"margin": true,
"padding": true
}
},
"example": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ describe( 'Global styles sidebar', () => {
const results = await page.$$(
'.edit-site-block-types-item-list div[role="listitem"]'
);
expect( results.length ).toEqual( 1 );
// Matches both Heading and Table of Contents blocks. (The latter contains "heading" in its description.)
expect( results.length ).toEqual( 2 );
} );
} );
} );