-
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
Allowable tags gettings stripped from Header blocks when drafts are auto-saved #5876
Comments
Thanks for the detailed report, @maddisondesigns I believe this is a deliberate design decision: any markup outside of the defined schema is stripped from the block. I'll let @aduth or @mtias confirm this though. Generally, there's some room for discussion on whether we alert the end user to the fact their data is being transformed (and some data removed in the process). Regardless, we should make sure the behavior is explicitly documented one way or another #4186 |
The |
Since |
@danielbachhuber We need to be able add tags like span into headers so that we can provide extra styling. There's been countless times where I've had to provide headings (both in the body content & the main title) where I've need to include The existing TinyMCE editor allows me to do this by switching to the Text tab so Gutenberg should allow me to do it as well. |
I've been unable to reproduce this in my testing. Can you verify whether this is still an issue? If so, could you list any other plugins you have active which may be manipulating saved post content? |
@aduth I just tested this with 2.7.0 and it looks like those tags no longer get stripped. I've only tested with |
I can confirm this is fixed. I tested with some |
Issue Overview
I wanted to add a header, with part of the text being enclosed in a
<span></span>
tag. When I tried to add the span tag in the Visual Editor, it simply escaped the angle brackets (which was expected).I then switched to the Code Editor, added in the span tags to my Headers and saved my draft
When I viewed the page on the front-end, the headers included my span tags as expected.
I then wanted to edit the span tags but now, every time it auto-saves, it removes my span tags.
Steps to Reproduce (for bugs)
<span>some text</span>
)Expected Behavior
Allowable tags such as
<span></span>
shouldn't be stripped when in the Code Editor either when saving or auto-savingCurrent Behavior
Strips allowable tags
Gutenberg 2.5.0
Firefox Quantum 59.0.2 (64-bit)
WP 4.9.4
The text was updated successfully, but these errors were encountered: