-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
HTML in Post Title causes error in the block editor. #39395
Comments
It sounds like a depreciation was introduced in Gutenberg 11.4. I believe these are associated in some way. HTML Validation Error: Element style not allowed as child of element body in this context HTML tags in post titles are gone when editing existing posts Home.html displays title from query loop instead of post-title |
Trying debugging this but it's an internal RichText thing. I wasn't able to follow properly. @ntsekouras or @ellatrix might know better. |
Did a little debugging on this today. The value of the child object is being output as:
For all intents and purposes it looks like an empty object with an undefined type: Update: Looks like the child element is being set within the first conditional block where the value is seen to be a string type, but the string is of zero length.
|
Tried to understand what's going on in this draft PR. I have details in the description and any feedback is welcome. |
@costdev is this still something we are trying to land in 6.0. If not, I will remove from the project board. Thanks! |
@ndiego I haven't had a chance to test the draft PR just yet - if anyone else is up for testing it, that would be great! Since the PR is still a draft approach that needs feedback from others familiar with the component, it might be best to take this off the milestone to give it more time. |
Hi! This problem is still present in 6.0.2. How can I solve this? |
Is this still an issue? I tried testing against WP trunk and the HTML gets stripped from the post title, even if I use the code editor mode. |
I'm unable to reproduce this as well; I'm comfortable closing them; please reopen if you are still experiencing this. |
Description
Originally reported on Trac 55371.
When HTML is in the Post Title, attempting to edit post shows the error: "The editor has encountered an unexpected error."
Step-by-step reproduction instructions
Using WordPress 5.9:
Posts > Add New
.Using WordPress 5.8:
Screenshots, screen recording, code snippet
Environment info
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: