-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Package] Blocks/packages/blocks/packages/blocks[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended[Type] RegressionRelated to a regression in the latest releaseRelated to a regression in the latest release
Description
Description
This was introduced sometime between blocks package versions 11.20.0 and 12.4.0 (block-editor versions 10.4 and 11.4). Unfortunately because all packages need to be updated together (and we're also entangled in a React 17 to 18 upgrade which is interdependent with this upgrade), I can't easily try intermediate versions to narrow this down any further.
It is happening for all block types we're using (paragraphs, headings, etc).
Here is a test case that passes in 11.20.0 and fails in 12.4.0:
import { createBlock, getBlockContent } from "@wordpress/blocks";
describe("GB block content behavior", () => {
beforeAll(() => {
registerCoreBlocks();
});
it("Does not add extraneous divs to content", () => {
const paragraphBlock = createBlock("core/paragraph", {
content: "Some text",
});
expect(getBlockContent(paragraphBlock)).toEqual("<p>Some text</p>");
});
});
Step-by-step reproduction instructions
import { createBlock, getBlockContent } from "@wordpress/blocks";const paragraphBlock = createBlock(PARAGRAPH_BLOCK_ID, { content: "Some text", });getBlockContent(paragraphBlock);
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Package] Blocks/packages/blocks/packages/blocks[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended[Type] RegressionRelated to a regression in the latest releaseRelated to a regression in the latest release
Type
Fields
Give feedbackNo fields configured for issues without a type.
