-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Opening Edit HTML on container blocks shows error "This block contains unexpected or invalid content" #49095
Comments
Thanks for contributing, @alvarotrigo! I can confirm the issue, labeling it as a bug. Side note: The "Convert to Blocks" action doesn't work when viewing the resolution modal. Screenshot |
I confirmed as well in WP 6.2 Beta 2. I expanded testing slightly @Mamaduka
|
Any workaround to be able to paste the HTML code to make it recognisable for Gutenberg as buttons? Trying to convert this to buttons but Gutenberg won't recognise it and instead show it as HTML: <div class="is-layout-flex wp-block-buttons">
<div class="wp-block-button">
<a class="wp-block-button__link wp-element-button" href="https://google.com">Demo1</a>
</div>
<div class="wp-block-button">
<a class="wp-block-button__link wp-element-button" href="https://google.com">Demo2</a>
</div>
</div> What I'm doing: |
Ok, got it! I just had to add HTML comments |
It must be some bug with how the parent block gets saved when returning from the code editing mode. I don't see any issues when entering the Code Editor and returning to the Visual Editor from Post Editor. I believe removing these blocks' menu items only hides the problem that will also exist for custom blocks. |
Let's reopen it with a revised title so we can figure out a general solution for the underlying problem. |
Description
I add two buttons.
I click on "Edit HTML"
And when I click back to "Edit visually" it shows the error "This block contains unexpected or invalid content" even though I didn't change anything at all.
Something's not right there?
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Video attached:
buttons-error.mp4
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
The text was updated successfully, but these errors were encountered: