Repository navigation
Conversation
Behind the "Optional block delimiters" experiment, HTML without block delimiters opens as blocks and is saved without them where possible. - Add @wordpress/html-api, a port of the WordPress HTML Tag Processor. - Read HTML outside delimiters as blocks instead of one Classic block. Elements no block reads become HTML blocks, with the blocks inside them editable. - Save untouched blocks exactly as written. Edited blocks change only what the edit changed, and get a delimiter only when reading the HTML back without one would give a different block. - Keep attributes a block doesn't know in `htmlAttributes`, show them in the editor and save them again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: +24.8 kB (+0.27%) Total Size: 9.09 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Custom Completer: should allow newlines after multiple option completions in
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inner blocks of a block like List were each read back on their own to decide whether they need a delimiter. A list item alone isn't a list item, so editing one saved the whole list with delimiters. Inner blocks are now read back as part of their parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove the experiment: HTML outside delimiters is always read as blocks, and blocks that weren't edited are always saved as they were read. New blocks get delimiters as before. - Without a DOM or the HTML block, HTML is read and saved as before. - The current version of a block reads its HTML first, keeping unknown attributes in `htmlAttributes`; older versions are tried after. - Invalid blocks are saved as they were read, and logged as before. - Pasting HTML outside delimiters goes through raw handling again. - The full content fixtures check what blocks save, with the source set aside; untouched content is checked by the delimiter tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only HTML without delimiters is read for blocks inside it. A delimited Custom HTML block keeps its static HTML, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A delimited block inside HTML without delimiters, like a paragraph in a section, used to cut the HTML apart when read, so saving one wrapped the whole HTML in a Custom HTML block. HTML outside delimiters is now read in one pass with the delimited blocks in it, which become inner blocks of an HTML block where they sit inside an element. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Post content is rendered with a parser that reads HTML outside block delimiters as blocks, the same way the editor does, so render filters see each block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
HTML without block delimiters, like a classic post, opens as blocks instead of one Classic block. Blocks that aren't edited are saved as they were read, and blocks read without delimiters stay without them unless an edit needs one. New blocks get delimiters as before.
Why?
So Gutenberg can edit any HTML, like a classic post, without converting it or adding block markup.
How?
@wordpress/html-api, a JS port of the WordPress HTML Tag Processor.htmlAttributes, shown in the editor and saved again.Testing Instructions
wp post create --post_title=Test --post_content='<p style="background:#fffbe6">Hello</p><section class="x"><h3>Title</h3><p>Text</p></section>'.Testing Instructions for Keyboard
Same as above, typing the edit with the keyboard.
Use of AI Tools
Written with Claude Code (Claude Opus 5.5), reviewed by me.
🤖 Generated with Claude Code