-
Notifications
You must be signed in to change notification settings - Fork 17
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
This block contains unexpected or invalid content. #36
Comments
Hi @vibrains, can you share what version of WordPress and/or Gutenberg you are running? Thanks |
@ndiego WordPress version: 6.3.1 |
Hmm interesting. I am not able to replicate this. Is there anything else you can share about your setup? |
FYI: it appears to be related to user capabilities when running a multisite - so in our case, a super admin was the only role that was able to add the icon blocks successfully; even an administrator encountered the same issue. https://wordpress.org/plugins/unfiltered-mu/ - adding this plugin fixes the issue. |
Thanks @TheoEnnismore for pointing us in the right direction! It's definitely because the inline SVG is being sanitized without the unfiltered_html capability. On MS, that's removed for pretty much everyone. On a single site, only editors and admins will have this capability. So an author, for example, could add an icon but then be surprised when it never displays. I think it would be better to not encourage enabling unfiltered_html widely. @ndiego I wonder if a possible solution might be to only store the reference to the SVG in the block's content, rather than the SVG itself. Then load the SVG into the editor when the editor is loaded, and add it to page views in the backend through PHP. Two problems I see with that, though:
But maybe those are reasonable given the risk of folks disabling unfiltered_html. |
Hi, I keep running into this issue:
When I resolve the block it looks like the invalid content is just empty spaces:
The text was updated successfully, but these errors were encountered: