-
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
Paragraph block fails validation and appears externally modified when content is valid #8950
Comments
Seems like when you change the class, the attribute isn't also updated which causes the mismatch and parser confusion. You end up with markup like so…
(I'm sure you know this, just putting it here for future searchers and readers!) So I guess the question is here would the expected behavior be that the attribute is somehow changed automatically based on the class name? Seems like the block would somehow need to be able to parse that out? And what would be the expectation if you change to a non-existent class name that doesn't match any size option? Should the size be removed entirely and the class applied as a custom class? |
Good call, I totally should have included that and failed to do so. Thanks! 👍🏻 I think if you change to a non-recognised class, it should use custom class, yes. |
There are default sourcing options. Those which don't fall neatly within available sources (like this one) must always keep the markup and attributes in sync, lest risk the validation issues demonstrated here. One note is whether the comment delimiters should be included in the "Edit as HTML" view, which could make these desyncs much more apparent when editing. This would be a separate enhancement task, however. The behavior as explained is expected.
A custom class is assigned correctly as long as the expected value from the assigned size is respected as well. For example, if at "Step 6" of the original instructions, the class is added instead of replaced, the class is shown as additional class in Advanced settings. Closing as working as intended. |
Describe the bug
A paragraph block that is edited as HTML appears externally modified even if the content is valid and what the visual editor would create. I originally thought this was related to me trying out a fix for #4413, but it appears in master as well.
To Reproduce
Steps to reproduce the behavior:
"has-large-font-size"
to"has-larger-font-size"
Expected behavior
The paragraph block doesn't appear externally modified and the size changes.
Screenshots
Additional context
Gutenberg 3.5.0 with WordPress 4.9.8
The text was updated successfully, but these errors were encountered: